diff --git a/board/eltec/bab7xx/Makefile b/board/eltec/bab7xx/Makefile
index 6e412c2..7d8ed26 100644
--- a/board/eltec/bab7xx/Makefile
+++ b/board/eltec/bab7xx/Makefile
@@ -30,7 +30,7 @@
 SOBJS	= asm_init.o
 
 $(LIB):	.depend $(OBJS) $(SOBJS)
-	$(AR) crv $@ $^
+	$(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
@@ -46,12 +46,3 @@
 sinclude .depend
 
 #########################################################################
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/bab7xx/asm_init.S b/board/eltec/bab7xx/asm_init.S
index 934fabe..3f88bc2 100644
--- a/board/eltec/bab7xx/asm_init.S
+++ b/board/eltec/bab7xx/asm_init.S
@@ -204,7 +204,7 @@
     beq     SD16MB2B
 
     li      r3, 0x0011          /* get number of internal banks */
-                                /* from spd for bank0/1 */
+				/* from spd for bank0/1 */
     bl      spdRead
 
     cmpli   0, 0, r3, 0x02
@@ -244,7 +244,7 @@
  * set the Memory Configuration Reg. 2
  */
     li      r3, 0x0111          /* get number of internal banks */
-                                /* from spd for bank2/3 */
+				/* from spd for bank2/3 */
     bl      spdRead
 
     cmpli   0, 0, r3, 0x02
@@ -269,13 +269,13 @@
  */
 S2D64MB4B:
     lis     r21, 0x8630         /* BSTOPRE = 0x80, REFREC = 6, */
-                                /* RDLAT = 3 */
+				/* RDLAT = 3 */
 
 /*
  * set the Memory Configuration Reg. 4
  */
     lis     r22, 0x2430         /* PRETOACT = 2, ACTOPRE = 4, */
-                                /* WCBUF = 1, RCBUF = 1 */
+				/* WCBUF = 1, RCBUF = 1 */
     ori     r22, r22, 0x2220    /* SDMODE = 0x022, ACTORW = 2 */
 
 /*
@@ -285,10 +285,10 @@
     bl      spdRead
 
     rlwinm  r16, r3, 2, 24, 29  /* calculate size in MByte */
-                                /* (128 MB max.) */
+				/* (128 MB max.) */
 
     li      r3, 0x0005          /* get number of banks from spd */
-                                /* for bank0/1 */
+				/* for bank0/1 */
     bl      spdRead
 
     cmpi    0, 0, r3, 2         /* 2 banks ? */
@@ -336,10 +336,10 @@
     bl      spdRead
 
     rlwinm  r18, r3, 2, 24, 29  /* calculate size in MByte */
-                                /* (128 MB max.) */
+				/* (128 MB max.) */
 
     li      r3, 0x0105          /* get number of banks from */
-                                /* spd bank0/1 */
+				/* spd bank0/1 */
     bl      spdRead
 
     cmpi    0, 0, r3, 2         /* 2 banks ? */
@@ -365,7 +365,7 @@
 
 getSpdRowBank01:
     li      r3, 0x0003          /* get number of row bits from */
-                                /* spd from bank0/1 */
+				/* spd from bank0/1 */
     bl      spdRead
     ori     r20, r20, (MCCR1_BK0_9BITS | MCCR1_BK1_9BITS)
     cmpli   0, 0, r3, 0x0009    /* bank0 -  9 row bits */
@@ -392,7 +392,7 @@
 
 getSpdRowBank23:
     li     r3, 0x0103           /* get number of row bits from */
-                                /* spd for bank2/3 */
+				/* spd for bank2/3 */
     bl      spdRead
 
     ori     r20, r20, (MCCR1_BK2_9BITS | MCCR1_BK3_9BITS)
@@ -415,13 +415,13 @@
 writeRowBits:
     lis     r21, 0x000a         /* CPX = 1, RAS6P = 4 */
     ori     r21, r21, 0x2293    /* CAS5 = 2, CP4 = 1, */
-                                /* CAS3 = 2, RCD2 = 2, RP = 3 */
+				/* CAS3 = 2, RCD2 = 2, RP = 3 */
 /*
  * set the Memory Configuration Reg. 4
  */
     lis     r22, 0x0010         /* all SDRAM parameter 0, */
-                                /* WCBUF flow through, */
-                                /* RCBUF registered */
+				/* WCBUF flow through, */
+				/* RCBUF registered */
 /*
  * get the size of bank 0-3
  */
@@ -429,7 +429,7 @@
     bl      spdRead
 
     li      r16, 0              /* bank size is: */
-                                /* (8*2^row*2^column)/0x100000 MB */
+				/* (8*2^row*2^column)/0x100000 MB */
     ori     r16, r16, 0x8000
     rlwnm   r16, r16, r3, 0, 31
 
@@ -439,7 +439,7 @@
     rlwnm   r16, r16, r3, 0, 31
 
     li      r3, 0x0005          /* get number of banks from */
-                                /* spd for bank0/1 */
+				/* spd for bank0/1 */
     bl      spdRead
 
     cmpi    0, 0, r3, 2         /* 2 banks ? */
@@ -487,7 +487,7 @@
     bl      spdRead
 
     li      r18, 0              /* bank size is: */
-                                /* (8*2^row*2^column)/0x100000 MB */
+				/* (8*2^row*2^column)/0x100000 MB */
     ori     r18, r18, 0x8000
     rlwnm   r18, r18, r3, 0, 31
 
@@ -497,7 +497,7 @@
     rlwnm   r18, r18, r3, 0, 31
 
     li      r3, 0x0105          /* get number of banks from */
-                                /* spd for bank2/3 */
+				/* spd for bank2/3 */
     bl      spdRead
 
     cmpi    0, 0, r3, 2         /* 2 banks ? */
@@ -701,28 +701,28 @@
 
 common3:
     li      r4, 0x1010          /* refesh cycle 1028 clocks */
-                                /*  left shifted 2 */
+				/*  left shifted 2 */
     cmpli   0, 0, r3, 0x0000    /* 15.6 us ? */
     beq     writeRefresh
 
     li      r4, 0x0808          /* refesh cycle 514 clocks */
-                                /* left shifted 2 */
+				/* left shifted 2 */
     cmpli   0, 0, r3, 0x0002    /* 7.8 us ? */
     beq     writeRefresh
 
     li      r4, 0x2020          /* refesh cycle 2056 clocks */
-                                /* left shifted 2 */
+				/* left shifted 2 */
     cmpli   0, 0, r3, 0x0003    /* 31.3 us ? */
     beq     writeRefresh
 
     li      r4, 0x4040          /* refesh cycle 4112 clocks */
-                                /* left shifted 2 */
+				/* left shifted 2 */
     cmpli   0, 0, r3, 0x0004    /* 62.5 us ? */
     beq     writeRefresh
 
     li      r4, 0
     ori     r4, r4, 0x8080      /* refesh cycle 8224 clocks */
-                                /* left shifted 2 */
+				/* left shifted 2 */
     cmpli   0, 0, r3, 0x0005    /* 125 us ? */
     beq     writeRefresh
 
@@ -916,7 +916,7 @@
     eieio
     li      r9, 0x03
     stb     r9, 3(r8)           /* 8 data bits, 1 stop bit, */
-                                /* no parity */
+				/* no parity */
     eieio
     li      r9, 0x0b
     stb     r9, 4(r8)           /* enable the receiver and transmitter */
@@ -928,7 +928,7 @@
     beq     waitEmpty
     li      r9, 0x47
     stb     r9, 3(r8)           /* send break, 8 data bits, */
-                                /* 2 stop bits, no parity */
+				/* 2 stop bits, no parity */
     eieio
 
     lis     r0, 0x0001
@@ -944,7 +944,7 @@
     beq     waitEmpty1
     li      r9, 0x07
     stb     r9, 3(r8)           /* 8 data bits, 2 stop bits, */
-                                /* no parity */
+				/* no parity */
     eieio
 
 /*
@@ -1473,15 +1473,3 @@
 Mmbyte:
     .ascii  " MB .......... \000"
     .align  4
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/bab7xx/bab7xx.c b/board/eltec/bab7xx/bab7xx.c
index 6f6f977..b74b055 100644
--- a/board/eltec/bab7xx/bab7xx.c
+++ b/board/eltec/bab7xx/bab7xx.c
@@ -45,7 +45,7 @@
     unsigned char data = gpio->dta1;
 
     if (data & 0x02)
-        return 66666666;
+	return 66666666;
 
     return 83333333;
 }
@@ -58,7 +58,7 @@
 ulong bab7xx_get_gclk_freq (void)
 {
     static const int pllratio_to_factor[] = {
-        00, 75, 70, 00, 20, 65, 100, 45, 30, 55, 40, 50, 80, 60, 35, 00,
+	00, 75, 70, 00, 20, 65, 100, 45, 30, 55, 40, 50, 80, 60, 35, 00,
     };
 
     return pllratio_to_factor[get_hid1 () >> 28] * (bab7xx_get_bus_freq() / 10);
@@ -72,7 +72,7 @@
 
     printf ("MPC7xx V%d.%d",(pvr >> 8) & 0xFF, pvr & 0xFF);
     printf (" at %ld / %ld MHz\n",  bab7xx_get_gclk_freq()/1000000,
-            bab7xx_get_bus_freq()/1000000);
+	    bab7xx_get_bus_freq()/1000000);
 
     return (0);
 }
@@ -131,8 +131,8 @@
 
     for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
     {
-        if (*reg != reg)
-            return -1;
+	if (*reg != reg)
+	    return -1;
     }
 #endif
 
@@ -147,11 +147,11 @@
 
     do
     {
-        if (i & 0x01)   /* is bank enabled ? */
-            memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
-        msar1 >>= 8;
-        mear1 >>= 8;
-        i     >>= 1;
+	if (i & 0x01)   /* is bank enabled ? */
+	    memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
+	msar1 >>= 8;
+	mear1 >>= 8;
+	i     >>= 1;
     } while (i);
 
     return (memSize * 0x100000);
@@ -222,20 +222,20 @@
     switch (line_number)
     {
     case 1:
-        sprintf (info," MPC7xx V%d.%d at %ld / %ld MHz",
-            (get_pvr() >> 8) & 0xFF,
-            get_pvr() & 0xFF,
-            bab7xx_get_gclk_freq()/1000000,
-            bab7xx_get_bus_freq()/1000000);
-        return;
+	sprintf (info," MPC7xx V%d.%d at %ld / %ld MHz",
+	    (get_pvr() >> 8) & 0xFF,
+	    get_pvr() & 0xFF,
+	    bab7xx_get_gclk_freq()/1000000,
+	    bab7xx_get_bus_freq()/1000000);
+	return;
     case 2:
-        sprintf (info, " ELTEC BAB7xx with %ld MB DRAM and %ld MB FLASH",
-            dram_size(0)/0x100000,
-            flash_init()/0x100000);
-        return;
+	sprintf (info, " ELTEC BAB7xx with %ld MB DRAM and %ld MB FLASH",
+	    dram_size(0)/0x100000,
+	    flash_init()/0x100000);
+	return;
     case 3:
-        sprintf (info, " %s", smi.modeIdent);
-        return;
+	sprintf (info, " %s", smi.modeIdent);
+	return;
     }
 
     /* no more info lines */
diff --git a/board/eltec/bab7xx/dc_srom.c b/board/eltec/bab7xx/dc_srom.c
index ef956e6..a44af6e 100644
--- a/board/eltec/bab7xx/dc_srom.c
+++ b/board/eltec/bab7xx/dc_srom.c
@@ -118,7 +118,7 @@
     a = (char)(offset << 2);
     for (i=0; i<6; i++, a <<= 1)
     {
-        srom_latch(command | ((a < 0) ? DT_IN : 0), addr);
+	srom_latch(command | ((a < 0) ? DT_IN : 0), addr);
     }
     udelay(1);
 
@@ -136,11 +136,11 @@
 
     for (i=0; i<16; i++)
     {
-        sendto_srom(command  | DT_CLK, addr);
-        tmp = getfrom_srom(addr);
-        sendto_srom(command, addr);
+	sendto_srom(command  | DT_CLK, addr);
+	tmp = getfrom_srom(addr);
+	sendto_srom(command, addr);
 
-        word = (word << 1) | ((tmp >> 3) & 0x01);
+	word = (word << 1) | ((tmp >> 3) & 0x01);
     }
 
     sendto_srom(command & 0x0000ff00, addr);
@@ -160,13 +160,13 @@
 
     for (i=0; i<16; i++)
     {
-        tmp = (longVal & 0x8000)>>13;
+	tmp = (longVal & 0x8000)>>13;
 
-        sendto_srom (tmp | command, addr);
-        sendto_srom (tmp | command  | DT_CLK, addr);
-        sendto_srom (tmp | command, addr);
+	sendto_srom (tmp | command, addr);
+	sendto_srom (tmp | command  | DT_CLK, addr);
+	sendto_srom (tmp | command, addr);
 
-        longVal = longVal<<1;
+	longVal = longVal<<1;
     }
 
     sendto_srom(command & 0x0000ff00, addr);
@@ -175,15 +175,15 @@
     tmp = 100;
     do
     {
-        if ((getfrom_srom(dc_srom_iobase) & 0x8) == 0x8)
-            break;
-        udelay(1000);
+	if ((getfrom_srom(dc_srom_iobase) & 0x8) == 0x8)
+	    break;
+	udelay(1000);
     } while (--tmp);
 
     if (tmp == 0)
     {
-        printf("Write DEC21143 SRom timed out !\n");
-        return (-1);
+	printf("Write DEC21143 SRom timed out !\n");
+	return (-1);
     }
 
     return 0;
@@ -218,7 +218,7 @@
 
     for (i=0; i<6; i++)
     {
-        srom_latch (SROM_WR | SROM_SR | DT_IN | DT_CS, addr);
+	srom_latch (SROM_WR | SROM_SR | DT_IN | DT_CS, addr);
     }
 }
 
@@ -256,8 +256,8 @@
     memset (dest, 0, 128);
     for (offset=0; offset<64; offset++)
     {
-        tmp = srom_rd (dc_srom_iobase, offset);
-        *dest++ = le16_to_cpu(tmp);
+	tmp = srom_rd (dc_srom_iobase, offset);
+	*dest++ = le16_to_cpu(tmp);
     }
 
     return (0);
@@ -280,9 +280,9 @@
 
     for (offset=0; offset<64; offset++)
     {
-        if (srom_wr (dc_srom_iobase, offset, *src) == -1)
-                return (-1);
-        src++;
+	if (srom_wr (dc_srom_iobase, offset, *src) == -1)
+		return (-1);
+	src++;
     }
 
     return (0);
diff --git a/board/eltec/bab7xx/el_srom.c b/board/eltec/bab7xx/el_srom.c
index 56abdc7..73f8066 100644
--- a/board/eltec/bab7xx/el_srom.c
+++ b/board/eltec/bab7xx/el_srom.c
@@ -83,14 +83,14 @@
 
     for (i = 0; i < 8; i++)
     {
-        out8(I2C_BUS_DAT, 0x00);    /* SCLK = low   SDIO = high */
-        udelay(10);
-        out8(I2C_BUS_DAT, 0x40);    /* SCLK = high  SDIO = high */
-        udelay(15);
-        buf <<= 1;
-        buf = (in8(I2C_BUS_DAT) & 0x20) ? (buf | 0x01) : (buf & 0xFE);
-        out8(I2C_BUS_DAT, 0x00);    /* SCLK = low   SDIO = high */
-        udelay(10);
+	out8(I2C_BUS_DAT, 0x00);    /* SCLK = low   SDIO = high */
+	udelay(10);
+	out8(I2C_BUS_DAT, 0x40);    /* SCLK = high  SDIO = high */
+	udelay(15);
+	buf <<= 1;
+	buf = (in8(I2C_BUS_DAT) & 0x20) ? (buf | 0x01) : (buf & 0xFE);
+	out8(I2C_BUS_DAT, 0x00);    /* SCLK = low   SDIO = high */
+	udelay(10);
     }
     return(buf);
 }
@@ -113,13 +113,13 @@
 
     for (i = 7; i >= 0; i--)
     {
-        (buf & 0x80) ? out8(I2C_BUS_DAT, 0x20) : out8(I2C_BUS_DAT, 0x00); /* SCLK=low  SDIO=data */
-        udelay(10);
-        (buf & 0x80) ? out8(I2C_BUS_DAT, 0x60) : out8(I2C_BUS_DAT, 0x40); /* SCLK=high SDIO=data */
-        udelay(15);
-        (buf & 0x80) ? out8(I2C_BUS_DAT, 0x20) : out8(I2C_BUS_DAT, 0x00); /* SCLK=low  SDIO=data */
-        udelay(10);
-        buf <<= 1;
+	(buf & 0x80) ? out8(I2C_BUS_DAT, 0x20) : out8(I2C_BUS_DAT, 0x00); /* SCLK=low  SDIO=data */
+	udelay(10);
+	(buf & 0x80) ? out8(I2C_BUS_DAT, 0x60) : out8(I2C_BUS_DAT, 0x40); /* SCLK=high SDIO=data */
+	udelay(15);
+	(buf & 0x80) ? out8(I2C_BUS_DAT, 0x20) : out8(I2C_BUS_DAT, 0x00); /* SCLK=low  SDIO=data */
+	udelay(10);
+	buf <<= 1;
     }
 }
 
@@ -184,39 +184,39 @@
 
     for (i=0;i<cnt;i++)
     {
-        eepStart();
-        eepWriteByte(0xA0 | device | block);
-        if (eepReadAck() == ERROR)
-        {
-           eepStop();
-            return(ERROR);
-        }
-        eepWriteByte(addr++);
-        if (eepReadAck() == ERROR)
-        {
-            eepStop();
-            return(ERROR);
-        }
-        eepStart();
+	eepStart();
+	eepWriteByte(0xA0 | device | block);
+	if (eepReadAck() == ERROR)
+	{
+	   eepStop();
+	    return(ERROR);
+	}
+	eepWriteByte(addr++);
+	if (eepReadAck() == ERROR)
+	{
+	    eepStop();
+	    return(ERROR);
+	}
+	eepStart();
 
-        eepWriteByte(0xA1 | device | block);
-        if (eepReadAck() == ERROR)
-        {
-            eepStop();
-            return(ERROR);
-        }
+	eepWriteByte(0xA1 | device | block);
+	if (eepReadAck() == ERROR)
+	{
+	    eepStop();
+	    return(ERROR);
+	}
 
-        *buf++ = eepReadByte();
-        eepWriteAck(1);
-        eepStop();
+	*buf++ = eepReadByte();
+	eepWriteAck(1);
+	eepStop();
 
-        if ((addr == 0) && (i != (cnt-1)))    /* is it the same block ? */
-        {
-            if (block == FIRST_BLOCK)
-                block = SECOND_BLOCK;
-            else
-                return(ERROR);
-        }
+	if ((addr == 0) && (i != (cnt-1)))    /* is it the same block ? */
+	{
+	    if (block == FIRST_BLOCK)
+		block = SECOND_BLOCK;
+	    else
+		return(ERROR);
+	}
     }
     return(cnt);
 }
@@ -235,31 +235,31 @@
 
     for (i=0;i<cnt;i++)
     {
-        retVal = ERROR;
-        do
-        {
-            eepStart();
-            eepWriteByte(0xA0 | device | block);
-            if ((retVal = eepReadAck()) == ERROR)
-                eepStop();
-        } while (retVal == ERROR);
+	retVal = ERROR;
+	do
+	{
+	    eepStart();
+	    eepWriteByte(0xA0 | device | block);
+	    if ((retVal = eepReadAck()) == ERROR)
+		eepStop();
+	} while (retVal == ERROR);
 
-        eepWriteByte(addr++);
-        if (eepReadAck() == ERROR)  return(ERROR);
+	eepWriteByte(addr++);
+	if (eepReadAck() == ERROR)  return(ERROR);
 
-        if ((addr == 0) && (i != (cnt-1)))    /* is it the same block ? */
-        {
-            if (block == FIRST_BLOCK)
-                block = SECOND_BLOCK;
-            else
-            return(ERROR);
-        }
+	if ((addr == 0) && (i != (cnt-1)))    /* is it the same block ? */
+	{
+	    if (block == FIRST_BLOCK)
+		block = SECOND_BLOCK;
+	    else
+	    return(ERROR);
+	}
 
-        eepWriteByte(*buf++);
-        if (eepReadAck() == ERROR)
-            return(ERROR);
+	eepWriteByte(*buf++);
+	if (eepReadAck() == ERROR)
+	    return(ERROR);
 
-        eepStop();
+	eepStop();
     }
     return(cnt);
 }
@@ -278,13 +278,13 @@
 
     for (; size; size--)
     {
-        byte = *ptr++;
-        for (i = 8; i; i--)
-        {
-            f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
-            accu >>= 1; accu ^= f;
-            byte >>= 1;
-        }
+	byte = *ptr++;
+	for (i = 8; i; i--)
+	{
+	    f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
+	    accu >>= 1; accu ^= f;
+	    byte >>= 1;
+	}
     }
     return(accu);
 }
diff --git a/board/eltec/bab7xx/flash.c b/board/eltec/bab7xx/flash.c
index 73496a1..442dd00 100644
--- a/board/eltec/bab7xx/flash.c
+++ b/board/eltec/bab7xx/flash.c
@@ -57,7 +57,7 @@
     /* Init: no FLASHes known */
     for (i=0; i<CFG_MAX_FLASH_BANKS; ++i)
     {
-        flash_info[i].flash_id = FLASH_UNKNOWN;
+	flash_info[i].flash_id = FLASH_UNKNOWN;
     }
 
     /* initialise 1st flash */
@@ -65,8 +65,8 @@
 
     if (flash_info[0].flash_id == FLASH_UNKNOWN)
     {
-        printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-            size1, size1<<20);
+	printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
+	    size1, size1<<20);
     }
 
     /* initialise 2nd flash */
@@ -74,31 +74,31 @@
 
     if (flash_info[1].flash_id == FLASH_UNKNOWN)
     {
-        printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
-            size2, size2<<20);
+	printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
+	    size2, size2<<20);
     }
 
     /* monitor protection ON by default */
     if (size1 == 512*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                FLASH_BASE0_PRELIM,
-                FLASH_BASE0_PRELIM+monitor_flash_len-1,
-                &flash_info[0]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		FLASH_BASE0_PRELIM,
+		FLASH_BASE0_PRELIM+monitor_flash_len-1,
+		&flash_info[0]);
     }
     if (size2 == 512*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                FLASH_BASE1_PRELIM,
-                FLASH_BASE1_PRELIM+monitor_flash_len-1,
-                &flash_info[1]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		FLASH_BASE1_PRELIM,
+		FLASH_BASE1_PRELIM+monitor_flash_len-1,
+		&flash_info[1]);
     }
     if (size2 == 4*1024*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                CFG_FLASH_BASE,
-                CFG_FLASH_BASE+monitor_flash_len-1,
-                &flash_info[1]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		CFG_FLASH_BASE,
+		CFG_FLASH_BASE+monitor_flash_len-1,
+		&flash_info[1]);
     }
 
     return (size1 + size2);
@@ -115,72 +115,72 @@
     volatile unsigned long *flash;
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        flash_init();
+	printf ("missing or unknown FLASH type\n");
+	flash_init();
     }
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        return;
+	printf ("missing or unknown FLASH type\n");
+	return;
     }
 
     switch (info->flash_id & FLASH_VENDMASK) {
     case FLASH_MAN_AMD:
-        printf ("AMD ");
-        break;
+	printf ("AMD ");
+	break;
     default:
-        printf ("Unknown Vendor ");
-        break;
+	printf ("Unknown Vendor ");
+	break;
     }
 
     switch (info->flash_id & FLASH_TYPEMASK) {
     case AMD_ID_F040B:
-        printf ("AM29F040B (4 Mbit)\n");
-        break;
+	printf ("AM29F040B (4 Mbit)\n");
+	break;
     case AMD_ID_F016D:
-        printf ("AM29F016D (16 Mbit)\n");
-        break;
+	printf ("AM29F016D (16 Mbit)\n");
+	break;
     case AMD_ID_F032B:
-        printf ("AM29F032B (32 Mbit)\n");
-        break;
+	printf ("AM29F032B (32 Mbit)\n");
+	break;
    default:
-        printf ("Unknown Chip Type\n");
-        break;
+	printf ("Unknown Chip Type\n");
+	break;
     }
 
     if (info->size >= (1 << 20)) {
-        printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
+	printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
     } else {
-        printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
+	printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
     }
 
     printf ("  Sector Start Addresses:");
     for (i=0; i<info->sector_count; ++i) {
-        /*
-        * Check if whole sector is erased
-        */
-        if (i != (info->sector_count-1))
-            size = info->start[i+1] - info->start[i];
-        else
-            size = info->start[0] + info->size - info->start[i];
+	/*
+	* Check if whole sector is erased
+	*/
+	if (i != (info->sector_count-1))
+	    size = info->start[i+1] - info->start[i];
+	else
+	    size = info->start[0] + info->size - info->start[i];
 
-        erased = 1;
-        flash = (volatile unsigned long *)info->start[i];
-        size = size >> 2;        /* divide by 4 for longword access */
-        for (k=0; k<size; k++) {
-            if (*flash++ != 0xffffffff) {
-                erased = 0;
-                break;
-            }
-        }
+	erased = 1;
+	flash = (volatile unsigned long *)info->start[i];
+	size = size >> 2;        /* divide by 4 for longword access */
+	for (k=0; k<size; k++) {
+	    if (*flash++ != 0xffffffff) {
+		erased = 0;
+		break;
+	    }
+	}
 
-        if ((i % 5) == 0)
-            printf ("\n   ");
+	if ((i % 5) == 0)
+	    printf ("\n   ");
 
-        printf (" %08lX%s%s",
-            info->start[i],
-            erased ? " E" : "  ",
-            info->protect[i] ? "RO " : "   ");
+	printf (" %08lX%s%s",
+	    info->start[i],
+	    erased ? " E" : "  ",
+	    info->protect[i] ? "RO " : "   ");
     }
     printf ("\n");
 }
@@ -226,37 +226,37 @@
     /* We accept only two AMD types */
     switch (vendor) {
     case (FLASH_WORD_SIZE)AMD_MANUFACT:
-        info->flash_id = FLASH_MAN_AMD;
-        break;
+	info->flash_id = FLASH_MAN_AMD;
+	break;
     default:
-        info->flash_id = FLASH_UNKNOWN;
-        info->sector_count = 0;
-        info->size = 0;
-        return (0);         /* no or unknown flash  */
+	info->flash_id = FLASH_UNKNOWN;
+	info->sector_count = 0;
+	info->size = 0;
+	return (0);         /* no or unknown flash  */
     }
 
     switch (devid) {
     case (FLASH_WORD_SIZE)AMD_ID_F040B:
-        info->flash_id |= AMD_ID_F040B;
-        info->sector_count = 8;
-        info->size = 0x00080000;
-        break;              /* => 0.5 MB      */
+	info->flash_id |= AMD_ID_F040B;
+	info->sector_count = 8;
+	info->size = 0x00080000;
+	break;              /* => 0.5 MB      */
 
     case (FLASH_WORD_SIZE)AMD_ID_F016D:
-        info->flash_id |= AMD_ID_F016D;
-        info->sector_count = 32;
-        info->size         = 0x00200000;
-        break;              /* => 2 MB      */
+	info->flash_id |= AMD_ID_F016D;
+	info->sector_count = 32;
+	info->size         = 0x00200000;
+	break;              /* => 2 MB      */
 
     case (FLASH_WORD_SIZE)AMD_ID_F032B:
-        info->flash_id |= AMD_ID_F032B;
-        info->sector_count = 64;
-        info->size         = 0x00400000;
-        break;              /* => 4 MB      */
+	info->flash_id |= AMD_ID_F032B;
+	info->sector_count = 64;
+	info->size         = 0x00400000;
+	break;              /* => 4 MB      */
 
     default:
-        info->flash_id = FLASH_UNKNOWN;
-        return (0);         /* => no or unknown flash */
+	info->flash_id = FLASH_UNKNOWN;
+	return (0);         /* => no or unknown flash */
 
     }
 
@@ -266,20 +266,20 @@
 
     /* check for protected sectors */
     for (i = 0; i < info->sector_count; i++) {
-        /* sector base address */
-        info->start[i] = base + i * (info->size / info->sector_count);
-        /* read sector protection at sector address, (A7 .. A0) = 0x02 */
-        /* D0 = 1 if protected */
-        caddr = (volatile unsigned char *)(info->start[i]);
-        info->protect[i] = caddr[2] & 1;
+	/* sector base address */
+	info->start[i] = base + i * (info->size / info->sector_count);
+	/* read sector protection at sector address, (A7 .. A0) = 0x02 */
+	/* D0 = 1 if protected */
+	caddr = (volatile unsigned char *)(info->start[i]);
+	info->protect[i] = caddr[2] & 1;
     }
 
     /*
      * Prevent writes to uninitialized FLASH.
      */
     if (info->flash_id != FLASH_UNKNOWN) {
-        caddr = (volatile unsigned char *)info->start[0];
-        caddr[0] = 0xF0;   /* reset bank */
+	caddr = (volatile unsigned char *)info->start[0];
+	caddr[0] = 0xF0;   /* reset bank */
     }
 
     return (info->size);
@@ -295,32 +295,32 @@
     int rc = 0;
 
     if ((s_first < 0) || (s_first > s_last)) {
-        if (info->flash_id == FLASH_UNKNOWN) {
-            printf ("- missing\n");
-        } else {
-            printf ("- no sectors to erase\n");
-        }
-        return 1;
+	if (info->flash_id == FLASH_UNKNOWN) {
+	    printf ("- missing\n");
+	} else {
+	    printf ("- no sectors to erase\n");
+	}
+	return 1;
     }
 
     if ((info->flash_id == FLASH_UNKNOWN) ||
-        (info->flash_id > FLASH_AMD_COMP)) {
-        printf ("Can't erase unknown flash type - aborted\n");
-        return 1;
+	(info->flash_id > FLASH_AMD_COMP)) {
+	printf ("Can't erase unknown flash type - aborted\n");
+	return 1;
     }
 
     prot = 0;
     for (sect=s_first; sect<=s_last; ++sect) {
-        if (info->protect[sect]) {
-            prot++;
-        }
+	if (info->protect[sect]) {
+	    prot++;
+	}
     }
 
     if (prot) {
-        printf ("- Warning: %d protected sectors will not be erased!\n",
-            prot);
+	printf ("- Warning: %d protected sectors will not be erased!\n",
+	    prot);
     } else {
-        printf ("\n");
+	printf ("\n");
     }
 
     l_sect = -1;
@@ -336,26 +336,26 @@
 
     /* Start erase on unprotected sectors */
     for (sect = s_first; sect<=s_last; sect++) {
-        if (info->protect[sect] == 0) { /* not protected */
-            addr = (FLASH_WORD_SIZE *)(info->start[sect]);
-            if (info->flash_id & FLASH_MAN_SST) {
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-                addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-                addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-                addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
-                udelay(30000);  /* wait 30 ms */
-            }
-            else
-                addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
-            l_sect = sect;
-        }
+	if (info->protect[sect] == 0) { /* not protected */
+	    addr = (FLASH_WORD_SIZE *)(info->start[sect]);
+	    if (info->flash_id & FLASH_MAN_SST) {
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+		addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+		addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+		addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
+		udelay(30000);  /* wait 30 ms */
+	    }
+	    else
+		addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
+	    l_sect = sect;
+	}
     }
 
     /* re-enable interrupts if necessary */
     if (flag)
-        enable_interrupts();
+	enable_interrupts();
 
     /* wait at least 80us - let's wait 1 ms */
     udelay (1000);
@@ -364,21 +364,21 @@
      * We wait for the last triggered sector
      */
     if (l_sect < 0)
-        goto DONE;
+	goto DONE;
 
     start = get_timer (0);
     last  = start;
     addr = (FLASH_WORD_SIZE *)(info->start[l_sect]);
     while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
-        if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
-            printf ("Timeout\n");
-            return 1;
-        }
-        /* show that we're waiting */
-        if ((now - last) > 1000) {  /* every second */
-            serial_putc ('.');
-            last = now;
-        }
+	if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
+	    printf ("Timeout\n");
+	    return 1;
+	}
+	/* show that we're waiting */
+	if ((now - last) > 1000) {  /* every second */
+	    serial_putc ('.');
+	    last = now;
+	}
     }
 
 DONE:
@@ -408,42 +408,42 @@
      * handle unaligned start bytes
      */
     if ((l = addr - wp) != 0) {
-        data = 0;
-        for (i=0, cp=wp; i<l; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
-        for (; i<4 && cnt>0; ++i) {
-            data = (data << 8) | *src++;
-            --cnt;
-            ++cp;
-        }
-        for (; cnt==0 && i<4; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
+	data = 0;
+	for (i=0, cp=wp; i<l; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
+	for (; i<4 && cnt>0; ++i) {
+	    data = (data << 8) | *src++;
+	    --cnt;
+	    ++cp;
+	}
+	for (; cnt==0 && i<4; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
 
-        if ((rc = write_word(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp += 4;
+	if ((rc = write_word(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp += 4;
     }
 
     /*
      * handle word aligned part
      */
     while (cnt >= 4) {
-        data = 0;
-        for (i=0; i<4; ++i) {
-            data = (data << 8) | *src++;
-        }
-        if ((rc = write_word(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp  += 4;
-        cnt -= 4;
+	data = 0;
+	for (i=0; i<4; ++i) {
+	    data = (data << 8) | *src++;
+	}
+	if ((rc = write_word(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp  += 4;
+	cnt -= 4;
     }
 
     if (cnt == 0) {
-        return (0);
+	return (0);
     }
 
     /*
@@ -451,11 +451,11 @@
      */
     data = 0;
     for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
-        data = (data << 8) | *src++;
-        --cnt;
+	data = (data << 8) | *src++;
+	--cnt;
     }
     for (; i<4; ++i, ++cp) {
-        data = (data << 8) | (*(uchar *)cp);
+	data = (data << 8) | (*(uchar *)cp);
     }
 
     return (write_word(info, wp, data));
@@ -469,45 +469,44 @@
  */
 static int write_word (flash_info_t *info, ulong dest, ulong data)
 {
-        volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
-        volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
-        volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
+	volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
+	volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
+	volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
     ulong start;
     int flag;
-        int i;
+	int i;
 
     /* Check if Flash is (sufficiently) erased */
     if ((*((volatile FLASH_WORD_SIZE *)dest) &
-             (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
-        return (2);
+	     (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
+	return (2);
     }
     /* Disable interrupts which might cause a timeout here */
     flag = disable_interrupts();
 
-        for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
-          {
-            addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-            addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-            addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
+	for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
+	  {
+	    addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+	    addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+	    addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
 
-            dest2[i] = data2[i];
+	    dest2[i] = data2[i];
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-              enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+	      enable_interrupts();
 
-            /* data polling for D7 */
-            start = get_timer (0);
-            while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
-                   (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
-              if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
-                return (1);
-              }
-            }
-          }
+	    /* data polling for D7 */
+	    start = get_timer (0);
+	    while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
+		   (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
+	      if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
+		return (1);
+	      }
+	    }
+	  }
 
     return (0);
 }
 
 /*----------------------------------------------------------------------------*/
-
diff --git a/board/eltec/bab7xx/l2cache.c b/board/eltec/bab7xx/l2cache.c
index 748d515..077f2c9 100644
--- a/board/eltec/bab7xx/l2cache.c
+++ b/board/eltec/bab7xx/l2cache.c
@@ -51,104 +51,104 @@
 {
     if (l2control)              /* BAB750 */
     {
-        mtspr(SPRN_L2CR, l2control);
-        mtspr(SPRN_L2CR, (l2control | L2CR_I));
-        while (mfspr(SPRN_L2CR) & L2CR_IP)
-            ;
-        mtspr(SPRN_L2CR, (l2control | L2CR_E));
-        return (0);
+	mtspr(SPRN_L2CR, l2control);
+	mtspr(SPRN_L2CR, (l2control | L2CR_I));
+	while (mfspr(SPRN_L2CR) & L2CR_IP)
+	    ;
+	mtspr(SPRN_L2CR, (l2control | L2CR_E));
+	return (0);
     }
     else /* BAB740 */
     {
-        int picr1, picr2, mask;
-        int picr2CacheSize, cacheSize;
-        int *d;
-        int devbusfn;
-        u32 reg32;
+	int picr1, picr2, mask;
+	int picr2CacheSize, cacheSize;
+	int *d;
+	int devbusfn;
+	u32 reg32;
 
-        devbusfn = pci_find_device(PCI_VENDOR_ID_MOTOROLA,
-                                   PCI_DEVICE_ID_MOTOROLA_MPC106, 0);
-        if (devbusfn == -1)
-            return (-1);
+	devbusfn = pci_find_device(PCI_VENDOR_ID_MOTOROLA,
+				   PCI_DEVICE_ID_MOTOROLA_MPC106, 0);
+	if (devbusfn == -1)
+	    return (-1);
 
-        pci_read_config_dword  (devbusfn, PCI_PICR2, &reg32);
-        reg32 &= ~PICR2_L2_EN;
-        pci_write_config_dword (devbusfn, PCI_PICR2, reg32);
+	pci_read_config_dword  (devbusfn, PCI_PICR2, &reg32);
+	reg32 &= ~PICR2_L2_EN;
+	pci_write_config_dword (devbusfn, PCI_PICR2, reg32);
 
-        /* cache size */
-        if (*(volatile unsigned char *) (CFG_ISA_IO + 0x220) & 0x04)
-        {
-            /* cache size is 512 KB */
-            picr2CacheSize = PICR2_L2_SIZE_512K;
-            cacheSize = 0x80000;
-        }
-        else
-        {
-            /* cache size is 256 KB */
-            picr2CacheSize = PICR2_L2_SIZE_256K;
-            cacheSize = 0x40000;
-        }
+	/* cache size */
+	if (*(volatile unsigned char *) (CFG_ISA_IO + 0x220) & 0x04)
+	{
+	    /* cache size is 512 KB */
+	    picr2CacheSize = PICR2_L2_SIZE_512K;
+	    cacheSize = 0x80000;
+	}
+	else
+	{
+	    /* cache size is 256 KB */
+	    picr2CacheSize = PICR2_L2_SIZE_256K;
+	    cacheSize = 0x40000;
+	}
 
-        /* setup PICR1 */
-        mask =
-        ~(PICR1_CF_BREAD_WS(1) |
-          PICR1_CF_BREAD_WS(2) |
-          PICR1_CF_CBA(0xff) |
-          PICR1_CF_CACHE_1G |
-          PICR1_CF_DPARK |
-          PICR1_CF_APARK |
-          PICR1_CF_L2_CACHE_MASK);
+	/* setup PICR1 */
+	mask =
+	~(PICR1_CF_BREAD_WS(1) |
+	  PICR1_CF_BREAD_WS(2) |
+	  PICR1_CF_CBA(0xff) |
+	  PICR1_CF_CACHE_1G |
+	  PICR1_CF_DPARK |
+	  PICR1_CF_APARK |
+	  PICR1_CF_L2_CACHE_MASK);
 
-        picr1 =
-        (PICR1_CF_CBA(0x3f) |
-         PICR1_CF_CACHE_1G |
-         PICR1_CF_APARK |
-         PICR1_CF_DPARK |
-         PICR1_CF_L2_COPY_BACK); /* PICR1_CF_L2_WRITE_THROUGH */
+	picr1 =
+	(PICR1_CF_CBA(0x3f) |
+	 PICR1_CF_CACHE_1G |
+	 PICR1_CF_APARK |
+	 PICR1_CF_DPARK |
+	 PICR1_CF_L2_COPY_BACK); /* PICR1_CF_L2_WRITE_THROUGH */
 
-        pci_read_config_dword  (devbusfn, PCI_PICR1, &reg32);
-        reg32 &= mask;
-        reg32 |= picr1;
-        pci_write_config_dword (devbusfn, PCI_PICR1, reg32);
+	pci_read_config_dword  (devbusfn, PCI_PICR1, &reg32);
+	reg32 &= mask;
+	reg32 |= picr1;
+	pci_write_config_dword (devbusfn, PCI_PICR1, reg32);
 
-        /*
-         * invalidate all L2 cache
-         */
-        picr2 =
-        (PICR2_CF_INV_MODE |
-         PICR2_CF_HIT_HIGH |
-         PICR2_CF_MOD_HIGH |
-         PICR2_CF_L2_HIT_DELAY(1) |
-         PICR2_CF_APHASE_WS(1) |
-         picr2CacheSize);
+	/*
+	 * invalidate all L2 cache
+	 */
+	picr2 =
+	(PICR2_CF_INV_MODE |
+	 PICR2_CF_HIT_HIGH |
+	 PICR2_CF_MOD_HIGH |
+	 PICR2_CF_L2_HIT_DELAY(1) |
+	 PICR2_CF_APHASE_WS(1) |
+	 picr2CacheSize);
 
-        pci_write_config_dword (devbusfn, PCI_PICR2, picr2);
+	pci_write_config_dword (devbusfn, PCI_PICR2, picr2);
 
-        /*
-         * dummy transactions
-         */
-        for (d=0; d<(int *)(2*cacheSize); d++)
-            dummy(*d);
+	/*
+	 * dummy transactions
+	 */
+	for (d=0; d<(int *)(2*cacheSize); d++)
+	    dummy(*d);
 
-        pci_write_config_dword (devbusfn, PCI_PICR2,
-                                (picr2 | PICR2_CF_FLUSH_L2));
+	pci_write_config_dword (devbusfn, PCI_PICR2,
+				(picr2 | PICR2_CF_FLUSH_L2));
 
-        /* setup PICR2 */
-        picr2 =
-        (PICR2_CF_FAST_CASTOUT |
-         PICR2_CF_WDATA |
-         PICR2_CF_ADDR_ONLY_DISABLE |
-         PICR2_CF_HIT_HIGH |
-         PICR2_CF_MOD_HIGH |
-         PICR2_L2_UPDATE_EN |
-         PICR2_L2_EN |
-         PICR2_CF_APHASE_WS(1) |
-         PICR2_CF_DATA_RAM_PBURST |
-         PICR2_CF_L2_HIT_DELAY(1) |
-         PICR2_CF_SNOOP_WS(2) |
-         picr2CacheSize);
+	/* setup PICR2 */
+	picr2 =
+	(PICR2_CF_FAST_CASTOUT |
+	 PICR2_CF_WDATA |
+	 PICR2_CF_ADDR_ONLY_DISABLE |
+	 PICR2_CF_HIT_HIGH |
+	 PICR2_CF_MOD_HIGH |
+	 PICR2_L2_UPDATE_EN |
+	 PICR2_L2_EN |
+	 PICR2_CF_APHASE_WS(1) |
+	 PICR2_CF_DATA_RAM_PBURST |
+	 PICR2_CF_L2_HIT_DELAY(1) |
+	 PICR2_CF_SNOOP_WS(2) |
+	 picr2CacheSize);
 
-        pci_write_config_dword (devbusfn, PCI_PICR2, picr2);
+	pci_write_config_dword (devbusfn, PCI_PICR2, picr2);
     }
     return (0);
 }
@@ -156,4 +156,3 @@
 /*----------------------------------------------------------------------------*/
 
 #endif /* (CFG_L2_BAB7xx) */
-
diff --git a/board/eltec/bab7xx/misc.c b/board/eltec/bab7xx/misc.c
index 1b4376d..b50d11b 100644
--- a/board/eltec/bab7xx/misc.c
+++ b/board/eltec/bab7xx/misc.c
@@ -62,7 +62,7 @@
     u_int  i, l, initSrom, copyNv;
     char buf[256];
     char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
-             0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
+	     0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
     pci_dev_t bdf;
 
     char sromSYM[] = {
@@ -131,204 +131,204 @@
 
     /* read out current revision srom contens */
     el_srom_load (0x0000, (u_char*)&eerev, sizeof(revinfo),
-                SECOND_DEVICE, FIRST_BLOCK);
+		SECOND_DEVICE, FIRST_BLOCK);
 
     /* read out current nvram shadow image */
     nvram_read (buf, CFG_NV_SROM_COPY_ADDR, CFG_SROM_SIZE);
 
     if (strcmp (eerev.magic, "ELTEC") != 0)
     {
-        /* srom is not initialized -> create a default revision info */
-        for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
-            *ptr++ = 0x00;
-        strcpy(eerev.magic, "ELTEC");
-        eerev.revrev[0] = 1;
-        eerev.revrev[1] = 0;
-        eerev.size = 0x00E0;
-        eerev.category[0] = 0x01;
+	/* srom is not initialized -> create a default revision info */
+	for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
+	    *ptr++ = 0x00;
+	strcpy(eerev.magic, "ELTEC");
+	eerev.revrev[0] = 1;
+	eerev.revrev[1] = 0;
+	eerev.size = 0x00E0;
+	eerev.category[0] = 0x01;
 
-        /* node id from dead e128 as default */
-        eerev.etheraddr[0] = 0x00;
-        eerev.etheraddr[1] = 0x00;
-        eerev.etheraddr[2] = 0x5B;
-        eerev.etheraddr[3] = 0x00;
-        eerev.etheraddr[4] = 0x2E;
-        eerev.etheraddr[5] = 0x4D;
+	/* node id from dead e128 as default */
+	eerev.etheraddr[0] = 0x00;
+	eerev.etheraddr[1] = 0x00;
+	eerev.etheraddr[2] = 0x5B;
+	eerev.etheraddr[3] = 0x00;
+	eerev.etheraddr[4] = 0x2E;
+	eerev.etheraddr[5] = 0x4D;
 
-        /* cache config word for bab750 */
-        *(int*)&eerev.res[0] = CLK2P0TO1_1MB_PB_0P5DH;
+	/* cache config word for bab750 */
+	*(int*)&eerev.res[0] = CLK2P0TO1_1MB_PB_0P5DH;
 
-        initSrom = 1;  /* force dialog */
-        copyNv   = 1;  /* copy to nvram */
+	initSrom = 1;  /* force dialog */
+	copyNv   = 1;  /* copy to nvram */
     }
 
     if ((copyNv == 0) &&   (el_srom_checksum((u_char*)&eerev, CFG_SROM_SIZE) !=
-                el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
+		el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
     {
-        printf ("Invalid revision info copy in nvram !\n");
-        printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
-        printf ("  <r> to reenter revision info.\n");
-        printf ("=> ");
-        if (0 != readline (NULL))
-        {
-            switch ((char)toupper(console_buffer[0]))
-            {
-            case 'C':
-                copyNv = 1;
-                break;
-            case 'R':
-                copyNv = 1;
-                initSrom = 1;
-                break;
-            }
-        }
+	printf ("Invalid revision info copy in nvram !\n");
+	printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
+	printf ("  <r> to reenter revision info.\n");
+	printf ("=> ");
+	if (0 != readline (NULL))
+	{
+	    switch ((char)toupper(console_buffer[0]))
+	    {
+	    case 'C':
+		copyNv = 1;
+		break;
+	    case 'R':
+		copyNv = 1;
+		initSrom = 1;
+		break;
+	    }
+	}
     }
 
     if (initSrom)
     {
-        memcpy (buf, &eerev.revision[0][0], 14);     /* save all revision info */
-        printf ("Enter revision number (0-9): %c  ", eerev.revision[0][0]);
-        if (0 != readline (NULL))
-        {
-            eerev.revision[0][0] = (char)toupper(console_buffer[0]);
-            memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
-        }
+	memcpy (buf, &eerev.revision[0][0], 14);     /* save all revision info */
+	printf ("Enter revision number (0-9): %c  ", eerev.revision[0][0]);
+	if (0 != readline (NULL))
+	{
+	    eerev.revision[0][0] = (char)toupper(console_buffer[0]);
+	    memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
+	}
 
-        printf ("Enter revision character (A-Z): %c  ", eerev.revision[0][1]);
-        if (1 == readline (NULL))
-        {
-            eerev.revision[0][1] = (char)toupper(console_buffer[0]);
-        }
+	printf ("Enter revision character (A-Z): %c  ", eerev.revision[0][1]);
+	if (1 == readline (NULL))
+	{
+	    eerev.revision[0][1] = (char)toupper(console_buffer[0]);
+	}
 
-        printf ("Enter board name (V-XXXX-XXXX): %s  ", (char *)&eerev.board);
-        if (11 == readline (NULL))
-        {
-            for (i=0; i<11; i++)
-                eerev.board[i] =  (char)toupper(console_buffer[i]);
-            eerev.board[11] = '\0';
-        }
+	printf ("Enter board name (V-XXXX-XXXX): %s  ", (char *)&eerev.board);
+	if (11 == readline (NULL))
+	{
+	    for (i=0; i<11; i++)
+		eerev.board[i] =  (char)toupper(console_buffer[i]);
+	    eerev.board[11] = '\0';
+	}
 
-        printf ("Enter serial number: %s ", (char *)&eerev.serial );
-        if (6 == readline (NULL))
-        {
-            for (i=0; i<6; i++)
-                eerev.serial[i] = console_buffer[i];
-            eerev.serial[6] = '\0';
-        }
+	printf ("Enter serial number: %s ", (char *)&eerev.serial );
+	if (6 == readline (NULL))
+	{
+	    for (i=0; i<6; i++)
+		eerev.serial[i] = console_buffer[i];
+	    eerev.serial[6] = '\0';
+	}
 
-        printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
-            eerev.etheraddr[0], eerev.etheraddr[1],
-            eerev.etheraddr[2], eerev.etheraddr[3],
-            eerev.etheraddr[4], eerev.etheraddr[5]);
-        if (12 == readline (NULL))
-        {
-            for (i=0; i<12; i+=2)
-            eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
-                               hex[toupper(console_buffer[i+1])-'0']);
-        }
+	printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
+	    eerev.etheraddr[0], eerev.etheraddr[1],
+	    eerev.etheraddr[2], eerev.etheraddr[3],
+	    eerev.etheraddr[4], eerev.etheraddr[5]);
+	if (12 == readline (NULL))
+	{
+	    for (i=0; i<12; i+=2)
+	    eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
+			       hex[toupper(console_buffer[i+1])-'0']);
+	}
 
-        l = strlen ((char *)&eerev.text);
-        printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
-        if (0 != readline (NULL))
-        {
-            for (i = l; i<63; i++)
-                eerev.text[i] = console_buffer[i-l];
-            eerev.text[63] = '\0';
-        }
+	l = strlen ((char *)&eerev.text);
+	printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
+	if (0 != readline (NULL))
+	{
+	    for (i = l; i<63; i++)
+		eerev.text[i] = console_buffer[i-l];
+	    eerev.text[63] = '\0';
+	}
 
-        if (strstr ((char *)&eerev.board, "75") != NULL)
-            eltec_board = 750;
-        else
-            eltec_board = 740;
+	if (strstr ((char *)&eerev.board, "75") != NULL)
+	    eltec_board = 750;
+	else
+	    eltec_board = 740;
 
-        if (eltec_board == 750)
-        {
-            if (CPU_TYPE == CPU_TYPE_750)
-                *(int*)&eerev.res[0] = CLK2P0TO1_1MB_PB_0P5DH;
-                else
-                *(int*)&eerev.res[0] = CLK2P5TO1_1MB_PB_0P5DH;
+	if (eltec_board == 750)
+	{
+	    if (CPU_TYPE == CPU_TYPE_750)
+		*(int*)&eerev.res[0] = CLK2P0TO1_1MB_PB_0P5DH;
+		else
+		*(int*)&eerev.res[0] = CLK2P5TO1_1MB_PB_0P5DH;
 
-            printf("Enter L2Cache config word with leading zero (HEX): %08X  ",
-                    *(int*)&eerev.res[0] );
-            if (0 != readline (NULL))
-            {
-                for (i=0; i<7; i+=2)
-                {
-                    eerev.res[i>>1] =
-                    (char)(16*hex[toupper(console_buffer[i])-'0'] +
-                    hex[toupper(console_buffer[i+1])-'0']);
-                }
-            }
+	    printf("Enter L2Cache config word with leading zero (HEX): %08X  ",
+		    *(int*)&eerev.res[0] );
+	    if (0 != readline (NULL))
+	    {
+		for (i=0; i<7; i+=2)
+		{
+		    eerev.res[i>>1] =
+		    (char)(16*hex[toupper(console_buffer[i])-'0'] +
+		    hex[toupper(console_buffer[i+1])-'0']);
+		}
+	    }
 
-            /* prepare network eeprom */
-            sromMII[20] = eerev.etheraddr[0];
-            sromMII[21] = eerev.etheraddr[1];
-            sromMII[22] = eerev.etheraddr[2];
-            sromMII[23] = eerev.etheraddr[3];
-            sromMII[24] = eerev.etheraddr[4];
-            sromMII[25] = eerev.etheraddr[5];
-            printf("\nSRom:  Writing DEC21143 MII info .. ");
+	    /* prepare network eeprom */
+	    sromMII[20] = eerev.etheraddr[0];
+	    sromMII[21] = eerev.etheraddr[1];
+	    sromMII[22] = eerev.etheraddr[2];
+	    sromMII[23] = eerev.etheraddr[3];
+	    sromMII[24] = eerev.etheraddr[4];
+	    sromMII[25] = eerev.etheraddr[5];
+	    printf("\nSRom:  Writing DEC21143 MII info .. ");
 
-            if (dc_srom_store ((u_short *)sromMII) == -1)
-                printf("FAILED\n");
-            else
-                printf("OK\n");
-        }
+	    if (dc_srom_store ((u_short *)sromMII) == -1)
+		printf("FAILED\n");
+	    else
+		printf("OK\n");
+	}
 
-        if (eltec_board == 740)
-        {
-            *(int *)&eerev.res[0] = 0;
-            sromSYM[20] = eerev.etheraddr[0];
-            sromSYM[21] = eerev.etheraddr[1];
-            sromSYM[22] = eerev.etheraddr[2];
-            sromSYM[23] = eerev.etheraddr[3];
-            sromSYM[24] = eerev.etheraddr[4];
-            sromSYM[25] = eerev.etheraddr[5];
-            printf("\nSRom:  Writing DEC21143 SYM info .. ");
+	if (eltec_board == 740)
+	{
+	    *(int *)&eerev.res[0] = 0;
+	    sromSYM[20] = eerev.etheraddr[0];
+	    sromSYM[21] = eerev.etheraddr[1];
+	    sromSYM[22] = eerev.etheraddr[2];
+	    sromSYM[23] = eerev.etheraddr[3];
+	    sromSYM[24] = eerev.etheraddr[4];
+	    sromSYM[25] = eerev.etheraddr[5];
+	    printf("\nSRom:  Writing DEC21143 SYM info .. ");
 
-            if (dc_srom_store ((u_short *)sromSYM) == -1)
-                printf("FAILED\n");
-            else
-                printf("OK\n");
-        }
+	    if (dc_srom_store ((u_short *)sromSYM) == -1)
+		printf("FAILED\n");
+	    else
+		printf("OK\n");
+	}
 
-        /* update CRC */
-        eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
+	/* update CRC */
+	eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
 
-        /* write new values */
-        printf("\nSRom:  Writing revision info ...... ");
-        if (el_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
-                            sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
-            printf("FAILED\n\n");
-        else
-            printf("OK\n\n");
+	/* write new values */
+	printf("\nSRom:  Writing revision info ...... ");
+	if (el_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
+			    sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
+	    printf("FAILED\n\n");
+	else
+	    printf("OK\n\n");
 
-        /* write new values as shadow image to nvram */
-        nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
+	/* write new values as shadow image to nvram */
+	nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
 
     } /*if (initSrom) */
 
     /* copy current values as shadow image to nvram */
     if (initSrom == 0 && copyNv == 1)
-        nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
+	nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
 
     /* update environment */
     sprintf (buf, "%02x:%02x:%02x:%02x:%02x:%02x",
-            eerev.etheraddr[0], eerev.etheraddr[1],
-            eerev.etheraddr[2], eerev.etheraddr[3],
-            eerev.etheraddr[4], eerev.etheraddr[5]);
+	    eerev.etheraddr[0], eerev.etheraddr[1],
+	    eerev.etheraddr[2], eerev.etheraddr[3],
+	    eerev.etheraddr[4], eerev.etheraddr[5]);
     setenv ("ethaddr", buf);
 
     /* print actual board identification */
     printf("Ident: %s  Ser %s  Rev %c%c\n",
-            eerev.board, (char *)&eerev.serial,
-            eerev.revision[0][0], eerev.revision[0][1]);
+	    eerev.board, (char *)&eerev.serial,
+	    eerev.revision[0][0], eerev.revision[0][1]);
 
     /* global board ident */
     if (strstr ((char *)&eerev.board, "75") != NULL)
-        eltec_board = 750;
+	eltec_board = 750;
     else
-        eltec_board = 740;
+	eltec_board = 740;
 
    /*
     * L2 cache configuration
@@ -337,12 +337,12 @@
     ptr = getenv("l2cache");
     if (*ptr == '0')
     {
-        printf ("Cache: L2 NOT activated on BAB%d\n", eltec_board);
+	printf ("Cache: L2 NOT activated on BAB%d\n", eltec_board);
     }
     else
     {
-        printf ("Cache: L2 activated on BAB%d\n", eltec_board);
-        l2_cache_enable(*(int*)&eerev.res[0]);
+	printf ("Cache: L2 activated on BAB%d\n", eltec_board);
+	l2_cache_enable(*(int*)&eerev.res[0]);
     }
 #endif
 
@@ -351,12 +351,12 @@
     */
     if ((ptr = getenv ("ata_reset_time")) != NULL)
     {
-        ata_reset_time = (int)simple_strtoul (ptr, NULL, 10);
+	ata_reset_time = (int)simple_strtoul (ptr, NULL, 10);
     }
     else
     {
-        sprintf (buf, "%d", ata_reset_time);
-        setenv ("ata_reset_time", buf);
+	sprintf (buf, "%d", ata_reset_time);
+	setenv ("ata_reset_time", buf);
     }
 
    /*
@@ -364,55 +364,55 @@
     */
     if ((ptr = getenv ("scsi_reset_time")) != NULL)
     {
-        scsi_reset_time = (int)simple_strtoul (ptr, NULL, 10);
+	scsi_reset_time = (int)simple_strtoul (ptr, NULL, 10);
     }
     else
     {
-        sprintf (buf, "%d", scsi_reset_time);
-        setenv ("scsi_reset_time", buf);
+	sprintf (buf, "%d", scsi_reset_time);
+	setenv ("scsi_reset_time", buf);
     }
 
 
     if ((bdf = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, 0)) > 0)
     {
-        if (pci_find_device(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C860, 0) > 0)
-        {
-            /* BAB740 with SCSI=IRQ 11; SCC=IRQ 9; no IDE; NCR860 at 80 Mhz */
-            scsi_dev_id = PCI_DEVICE_ID_NCR_53C860;
-            scsi_max_scsi_id = 7;
-            scsi_sym53c8xx_ccf = 0x15;
-            pci_write_config_byte (bdf, WINBOND_IDEIRCR, 0xb0);
-        }
+	if (pci_find_device(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C860, 0) > 0)
+	{
+	    /* BAB740 with SCSI=IRQ 11; SCC=IRQ 9; no IDE; NCR860 at 80 Mhz */
+	    scsi_dev_id = PCI_DEVICE_ID_NCR_53C860;
+	    scsi_max_scsi_id = 7;
+	    scsi_sym53c8xx_ccf = 0x15;
+	    pci_write_config_byte (bdf, WINBOND_IDEIRCR, 0xb0);
+	}
 
-        if ((ptr = getenv ("ide_dma_off")) != NULL)
-        {
-            u_long dma_off = simple_strtoul (ptr, NULL, 10);
-            /*
-            * setup user defined registers
-            * s.a. linux/drivers/ide/sl82c105.c
-            */
-            bdf |= PCI_BDF(0,0,1);            /* ide user reg at bdf function 1 */
-            if (dma_off & 1)
-            {
-                pci_write_config_byte (bdf, 0x46, 1);
-                printf("IDE:   DMA off flag set: Bus 0 : Dev 0\n");
-            }
-            if (dma_off & 2)
-            {
-                pci_write_config_byte (bdf, 0x4a, 1);
-                printf("IDE:   DMA off flag set: Bus 0 : Dev 1\n");
-            }
-            if (dma_off & 4)
-            {
-                pci_write_config_byte (bdf, 0x4e, 1);
-                printf("IDE:   DMA off flag set: Bus 1 : Dev 0\n");
-            }
-            if (dma_off & 8)
-            {
-                pci_write_config_byte (bdf, 0x52, 1);
-                printf("IDE:   DMA off flag set: Bus 1 : Dev 1\n");
-            }
-        }
+	if ((ptr = getenv ("ide_dma_off")) != NULL)
+	{
+	    u_long dma_off = simple_strtoul (ptr, NULL, 10);
+	    /*
+	    * setup user defined registers
+	    * s.a. linux/drivers/ide/sl82c105.c
+	    */
+	    bdf |= PCI_BDF(0,0,1);            /* ide user reg at bdf function 1 */
+	    if (dma_off & 1)
+	    {
+		pci_write_config_byte (bdf, 0x46, 1);
+		printf("IDE:   DMA off flag set: Bus 0 : Dev 0\n");
+	    }
+	    if (dma_off & 2)
+	    {
+		pci_write_config_byte (bdf, 0x4a, 1);
+		printf("IDE:   DMA off flag set: Bus 0 : Dev 1\n");
+	    }
+	    if (dma_off & 4)
+	    {
+		pci_write_config_byte (bdf, 0x4e, 1);
+		printf("IDE:   DMA off flag set: Bus 1 : Dev 0\n");
+	    }
+	    if (dma_off & 8)
+	    {
+		pci_write_config_byte (bdf, 0x52, 1);
+		printf("IDE:   DMA off flag set: Bus 1 : Dev 1\n");
+	    }
+	}
     }
     return (0);
 }
@@ -498,48 +498,48 @@
 
     if (eltec_board == 740)
     {
-        printf("SYM media select "); /* BAB740 */
-        /* start autoneg. with 10 mbit */
-        media_reg_init (dev, 0x3ffff, 0x08af0008, 0x00a10008, 0x00a50008, 0x02400080);
-        ext = status = 0;
-        for (i=0; i<2000+ext; i++)
-        {
-            status = INL(dev, DE4X5_SISR);
-            udelay(1000);
-            if (status & 0x2000) ext = 2000;
-            if ((status & 0x7000) == 0x5000) break;
-        }
+	printf("SYM media select "); /* BAB740 */
+	/* start autoneg. with 10 mbit */
+	media_reg_init (dev, 0x3ffff, 0x08af0008, 0x00a10008, 0x00a50008, 0x02400080);
+	ext = status = 0;
+	for (i=0; i<2000+ext; i++)
+	{
+	    status = INL(dev, DE4X5_SISR);
+	    udelay(1000);
+	    if (status & 0x2000) ext = 2000;
+	    if ((status & 0x7000) == 0x5000) break;
+	}
 
-        /* autoneg. ok -> 100MB FD */
-        if ((status & 0x0100f000) == 0x0100d000)
-        {
-            media_reg_init (dev, 0x37f7f, 0x08270008, 0x00210008, 0x00250008, 0x03c40280);
-            printf("100baseTx-FD\n");
-        }
-        /* autoneg. ok -> 100MB HD */
-        else if ((status & 0x0080f000) == 0x0080d000)
-        {
-            media_reg_init (dev, 0x17f7f, 0x08270008, 0x00210008, 0x00250008, 0x03c40080);
-            printf("100baseTx\n");
-        }
-        /* autoneg. ok -> 10MB FD */
-        else if ((status & 0x0040f000) == 0x0040d000)
-        {
-            media_reg_init (dev, 0x07f7f, 0x08af0008, 0x00a10008, 0x00a50008, 0x02400280);
-            printf("10baseT-FD\n");
-        }
-        /* autoneg. fail -> 10MB HD */
-        else
-        {
-            media_reg_init (dev, 0x7f7f, 0x08af0008, 0x00a10008, 0x00a50008,
-                        (OMR_SDP | OMR_TTM | OMR_PM));
-            printf("10baseT\n");
-        }
+	/* autoneg. ok -> 100MB FD */
+	if ((status & 0x0100f000) == 0x0100d000)
+	{
+	    media_reg_init (dev, 0x37f7f, 0x08270008, 0x00210008, 0x00250008, 0x03c40280);
+	    printf("100baseTx-FD\n");
+	}
+	/* autoneg. ok -> 100MB HD */
+	else if ((status & 0x0080f000) == 0x0080d000)
+	{
+	    media_reg_init (dev, 0x17f7f, 0x08270008, 0x00210008, 0x00250008, 0x03c40080);
+	    printf("100baseTx\n");
+	}
+	/* autoneg. ok -> 10MB FD */
+	else if ((status & 0x0040f000) == 0x0040d000)
+	{
+	    media_reg_init (dev, 0x07f7f, 0x08af0008, 0x00a10008, 0x00a50008, 0x02400280);
+	    printf("10baseT-FD\n");
+	}
+	/* autoneg. fail -> 10MB HD */
+	else
+	{
+	    media_reg_init (dev, 0x7f7f, 0x08af0008, 0x00a10008, 0x00a50008,
+			(OMR_SDP | OMR_TTM | OMR_PM));
+	    printf("10baseT\n");
+	}
     }
     else
     {
-        printf("MII media selected\n");                     /* BAB750 */
-        OUTL(dev, OMR_SDP | OMR_PS | OMR_PM, DE4X5_OMR);    /* CSR6 */
+	printf("MII media selected\n");                     /* BAB750 */
+	OUTL(dev, OMR_SDP | OMR_PS | OMR_PM, DE4X5_OMR);    /* CSR6 */
     }
 }
 #endif /* CONFIG_TULIP_SELECT_MEDIA */
diff --git a/board/eltec/bab7xx/pci.c b/board/eltec/bab7xx/pci.c
index a5fcfef..edbd3dd 100644
--- a/board/eltec/bab7xx/pci.c
+++ b/board/eltec/bab7xx/pci.c
@@ -43,48 +43,48 @@
     hose->last_busno = 0xff;
 
     pci_set_region(hose->regions + 0,
-        CFG_PCI_MEMORY_BUS,
-        CFG_PCI_MEMORY_PHYS,
+	CFG_PCI_MEMORY_BUS,
+	CFG_PCI_MEMORY_PHYS,
     /*
     * Attention: pci_hose_phys_to_bus() failes in address compare,
     * so we need (CFG_PCI_MEMORY_SIZE-1)
     */
-        CFG_PCI_MEMORY_SIZE-1,
-        PCI_REGION_MEM | PCI_REGION_MEMORY);
+	CFG_PCI_MEMORY_SIZE-1,
+	PCI_REGION_MEM | PCI_REGION_MEMORY);
 
     /* PCI memory space */
     pci_set_region(hose->regions + 1,
-        CFG_PCI_MEM_BUS,
-        CFG_PCI_MEM_PHYS,
-        CFG_PCI_MEM_SIZE,
-        PCI_REGION_MEM);
+	CFG_PCI_MEM_BUS,
+	CFG_PCI_MEM_PHYS,
+	CFG_PCI_MEM_SIZE,
+	PCI_REGION_MEM);
 
     /* ISA/PCI memory space */
     pci_set_region(hose->regions + 2,
-        CFG_ISA_MEM_BUS,
-        CFG_ISA_MEM_PHYS,
-        CFG_ISA_MEM_SIZE,
-        PCI_REGION_MEM);
+	CFG_ISA_MEM_BUS,
+	CFG_ISA_MEM_PHYS,
+	CFG_ISA_MEM_SIZE,
+	PCI_REGION_MEM);
 
     /* PCI I/O space */
     pci_set_region(hose->regions + 3,
-        CFG_PCI_IO_BUS,
-        CFG_PCI_IO_PHYS,
-        CFG_PCI_IO_SIZE,
-        PCI_REGION_IO);
+	CFG_PCI_IO_BUS,
+	CFG_PCI_IO_PHYS,
+	CFG_PCI_IO_SIZE,
+	PCI_REGION_IO);
 
     /* ISA/PCI I/O space */
     pci_set_region(hose->regions + 4,
-        CFG_ISA_IO_BUS,
-        CFG_ISA_IO_PHYS,
-        CFG_ISA_IO_SIZE,
-        PCI_REGION_IO);
+	CFG_ISA_IO_BUS,
+	CFG_ISA_IO_PHYS,
+	CFG_ISA_IO_SIZE,
+	PCI_REGION_IO);
 
     hose->region_count = 5;
 
     pci_setup_indirect(hose,
-        MPC106_REG_ADDR,
-        MPC106_REG_DATA);
+	MPC106_REG_ADDR,
+	MPC106_REG_DATA);
 
     pci_register_hose(hose);
 
@@ -93,9 +93,9 @@
     /* Initialises the MPC10x PCI Configuration regs. */
     pci_read_config_dword (PCI_BDF(0,0,0), PCI_PICR2, &reg32);
     reg32 |= PICR2_CF_SNOOP_WS(3) |
-             PICR2_CF_FLUSH_L2 |
-             PICR2_CF_L2_HIT_DELAY(3) |
-             PICR2_CF_APHASE_WS(3);
+	     PICR2_CF_FLUSH_L2 |
+	     PICR2_CF_L2_HIT_DELAY(3) |
+	     PICR2_CF_APHASE_WS(3);
     reg32 &= ~(PICR2_L2_EN | PICR2_L2_UPDATE_EN);
     pci_write_config_dword (PCI_BDF(0,0,0), PCI_PICR2, reg32);
 
@@ -108,12 +108,12 @@
 
     pci_read_config_dword (PCI_BDF(0,0,0), PCI_PICR1, &reg32);
     reg32 |= PICR1_CF_CBA(63) |
-             PICR1_CF_BREAD_WS(2) |
-             PICR1_MCP_EN |
-             PICR1_CF_DPARK |
-             PICR1_PROC_TYPE_604 |
-             PICR1_CF_LOOP_SNOOP |
-             PICR1_CF_APARK;
+	     PICR1_CF_BREAD_WS(2) |
+	     PICR1_MCP_EN |
+	     PICR1_CF_DPARK |
+	     PICR1_PROC_TYPE_604 |
+	     PICR1_CF_LOOP_SNOOP |
+	     PICR1_CF_APARK;
     pci_write_config_dword (PCI_BDF(0,0,0), PCI_PICR1, reg32);
 }
 
diff --git a/board/eltec/bab7xx/srom.h b/board/eltec/bab7xx/srom.h
index 7924bcd..c18ab91 100644
--- a/board/eltec/bab7xx/srom.h
+++ b/board/eltec/bab7xx/srom.h
@@ -81,18 +81,18 @@
 
 unsigned long el_srom_checksum (unsigned char *ptr, unsigned long size);
 int el_srom_load  (unsigned char addr, unsigned char *buf, int cnt,
-                   unsigned char device, unsigned char block);
+		   unsigned char device, unsigned char block);
 int el_srom_store (unsigned char addr, unsigned char *buf, int cnt,
-                   unsigned char device, unsigned char block);
+		   unsigned char device, unsigned char block);
 
 int mpc107_i2c_init (unsigned long eumb_addr, unsigned long divider);
 int mpc107_i2c_read_byte (unsigned char device, unsigned char block, unsigned char offset);
 int mpc107_i2c_write_byte (unsigned char device, unsigned char block,
-                           unsigned char offset, unsigned char val);
+			   unsigned char offset, unsigned char val);
 int mpc107_srom_load (unsigned char addr, unsigned char *pBuf, int cnt,
-                      unsigned char device, unsigned char block);
+		      unsigned char device, unsigned char block);
 int mpc107_srom_store (unsigned char addr, unsigned char *pBuf, int cnt,
-                       unsigned char device, unsigned char block);
+		       unsigned char device, unsigned char block);
 
 int dc_srom_load (unsigned short *dest);
 int dc_srom_store (unsigned short *src);
diff --git a/board/eltec/bab7xx/u-boot.lds b/board/eltec/bab7xx/u-boot.lds
index de50bf4..0dfa8c0 100644
--- a/board/eltec/bab7xx/u-boot.lds
+++ b/board/eltec/bab7xx/u-boot.lds
@@ -106,6 +106,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
diff --git a/board/eltec/elppc/Makefile b/board/eltec/elppc/Makefile
index 1ed1a24..76b2cfe 100644
--- a/board/eltec/elppc/Makefile
+++ b/board/eltec/elppc/Makefile
@@ -30,7 +30,7 @@
 SOBJS	= asm_init.o
 
 $(LIB):	.depend $(OBJS) $(SOBJS)
-	$(AR) crv $@ $^
+	$(AR) crv $@  $(OBJS) $(SOBJS)
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
@@ -46,12 +46,3 @@
 sinclude .depend
 
 #########################################################################
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/elppc/eepro100_srom.c b/board/eltec/elppc/eepro100_srom.c
index a5e47cf..9754c1d 100644
--- a/board/eltec/elppc/eepro100_srom.c
+++ b/board/eltec/elppc/eepro100_srom.c
@@ -32,7 +32,7 @@
 #include "srom.h"
 
 extern int eepro100_write_eeprom (struct eth_device* dev,
-                    int location, int addr_len, unsigned short data);
+		    int location, int addr_len, unsigned short data);
 
 /*----------------------------------------------------------------------------*/
 
@@ -43,7 +43,7 @@
 
     for (i = 0; i < (EE_SIZE-1); i++)
     {
-        sum += sromdata[i];
+	sum += sromdata[i];
     }
     return (EE_CHECKSUM - sum);
 }
@@ -57,7 +57,7 @@
 
     /* get onboard network iobase */
     pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-                 &onboard_dev.iobase);
+		 &onboard_dev.iobase);
     onboard_dev.iobase &= ~0xf;
 
     source[63] = eepro100_srom_checksum (source);
@@ -65,8 +65,8 @@
     for (count=0; count < EE_SIZE; count++)
     {
     if ( eepro100_write_eeprom ((struct eth_device*)&onboard_dev,
-             count, EE_ADDR_BITS, SROM_SHORT(source)) == -1 )
-        return -1;
+	     count, EE_ADDR_BITS, SROM_SHORT(source)) == -1 )
+	return -1;
     source++;
     }
     return 0;
@@ -89,22 +89,22 @@
 
     /* get onboard network iobase */
     pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-                 &onboard_dev.iobase);
+		 &onboard_dev.iobase);
     onboard_dev.iobase &= ~0xf;
 
     memset (destination, 0x65, 128);
 
     for (count=0; count < 0x40; count++)
     {
-        *destination++ = read_eeprom (struct eth_device*)&onboard_dev,
-                 count, EE_ADDR_BITS);
+	*destination++ = read_eeprom (struct eth_device*)&onboard_dev,
+		 count, EE_ADDR_BITS);
 #ifdef DEBUG
-        printf ("%04x ", *(destination - 1));
-        if (lr++ == 7)
-        {
-            printf("\n");
-            lr = 0;
-        }
+	printf ("%04x ", *(destination - 1));
+	if (lr++ == 7)
+	{
+	    printf("\n");
+	    lr = 0;
+	}
 #endif
     }
 }
diff --git a/board/eltec/elppc/elppc.c b/board/eltec/elppc/elppc.c
index 97b70a4..7b4d7d2 100644
--- a/board/eltec/elppc/elppc.c
+++ b/board/eltec/elppc/elppc.c
@@ -30,82 +30,81 @@
 
 int checkboard (void)
 {
-    puts ("Board: ELTEC PowerPC\n");
-    return (0);
+	puts ("Board: ELTEC PowerPC\n");
+	return (0);
 }
 
 /* ------------------------------------------------------------------------- */
 
 int checkflash (void)
 {
-    /* TODO */
-    printf ("Test not implemented !\n");
-    return (0);
+	/* TODO */
+	printf ("Test not implemented !\n");
+	return (0);
 }
 
 /* ------------------------------------------------------------------------- */
 
 static unsigned int mpc106_read_cfg_dword (unsigned int reg)
 {
-    unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
+	unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
 
-    out32r(MPC106_REG_ADDR, reg_addr);
+	out32r (MPC106_REG_ADDR, reg_addr);
 
-    return (in32r(MPC106_REG_DATA | (reg & 0x3)));
+	return (in32r (MPC106_REG_DATA | (reg & 0x3)));
 }
 
 /* ------------------------------------------------------------------------- */
 
 long int dram_size (int board_type)
 {
-    /*
-    * No actual initialisation to do - done when setting up
-    * PICRs MCCRs ME/SARs etc in asm_init.S.
-    */
+	/*
+	 * No actual initialisation to do - done when setting up
+	 * PICRs MCCRs ME/SARs etc in asm_init.S.
+	 */
 
-    register unsigned long i, msar1, mear1, memSize;
+	register unsigned long i, msar1, mear1, memSize;
 
 #if defined(CFG_MEMTEST)
-    register unsigned long reg;
+	register unsigned long reg;
 
-    printf("Testing DRAM\n");
+	printf ("Testing DRAM\n");
 
-    /* write each mem addr with it's address */
-    for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
-        *reg = reg;
+	/* write each mem addr with it's address */
+	for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg += 4)
+		*reg = reg;
 
-    for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg+=4)
-    {
-        if (*reg != reg)
-        return -1;
-    }
+	for (reg = CFG_MEMTEST_START; reg < CFG_MEMTEST_END; reg += 4) {
+		if (*reg != reg)
+			return -1;
+	}
 #endif
 
-    /*
-    * Since MPC107 memory controller chip has already been set to
-    * control all memory, just read and interpret its memory boundery register.
-    */
-    memSize = 0;
-    msar1 = mpc106_read_cfg_dword(MPC106_MSAR1);
-    mear1 = mpc106_read_cfg_dword(MPC106_MEAR1);
-    i     = mpc106_read_cfg_dword(MPC106_MBER) & 0xf;
+	/*
+	 * Since MPC107 memory controller chip has already been set to
+	 * control all memory, just read and interpret its memory boundery register.
+	 */
+	memSize = 0;
+	msar1 = mpc106_read_cfg_dword (MPC106_MSAR1);
+	mear1 = mpc106_read_cfg_dword (MPC106_MEAR1);
+	i = mpc106_read_cfg_dword (MPC106_MBER) & 0xf;
 
-    do
-    {
-        if (i & 0x01)   /* is bank enabled ? */
-            memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
-        msar1 >>= 8;
-        mear1 >>= 8;
-        i     >>= 1;
-    } while (i);
+	do {
+		if (i & 0x01)			/* is bank enabled ? */
+			memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
+		msar1 >>= 8;
+		mear1 >>= 8;
+		i >>= 1;
+	} while (i);
 
-    return (memSize * 0x100000);
+	return (memSize * 0x100000);
 }
+
 /* ------------------------------------------------------------------------- */
 
-long int initdram(int board_type)
+long int initdram (int board_type)
 {
-    return dram_size(board_type);
+	return dram_size (board_type);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -115,9 +114,10 @@
  * Register PI in the MPC 107 (at offset 0x41090 of the Embedded Utilities
  * Memory Block).
  */
-void do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+int do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-    out8(MPC107_EUMB_PI, 1);
+	out8 (MPC107_EUMB_PI, 1);
+	return (0);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -128,21 +128,21 @@
  * Since the 7xx CPUs don't have an internal watchdog, this function is
  * board specific.
  */
-void watchdog_reset(void)
+void watchdog_reset (void)
 {
 }
-#endif    /* CONFIG_WATCHDOG */
+#endif							/* CONFIG_WATCHDOG */
 
 /* ------------------------------------------------------------------------- */
 
 void after_reloc (ulong dest_addr)
 {
-    DECLARE_GLOBAL_DATA_PTR;
+	DECLARE_GLOBAL_DATA_PTR;
 
-    /*
-     * Jump to the main U-Boot board init code
-     */
-    board_init_r(gd, dest_addr);
+	/*
+	 * Jump to the main U-Boot board init code
+	 */
+	board_init_r (gd, dest_addr);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -152,38 +152,23 @@
 
 void video_get_info_str (int line_number, char *info)
 {
-    /* init video info strings for graphic console */
-    switch (line_number)
-    {
-    case 1:
-        sprintf (info," MPC7xx V%d.%d at %d / %d MHz",
-            (get_pvr() >> 8) & 0xFF,
-            get_pvr() & 0xFF,
-            400,
-            100);
-        return;
-    case 2:
-        sprintf (info, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
-            dram_size(0)/0x100000,
-            flash_init()/0x100000);
-        return;
-    case 3:
-        sprintf (info, " %s", smi.modeIdent);
-        return;
-    }
+	/* init video info strings for graphic console */
+	switch (line_number) {
+	case 1:
+		sprintf (info, " MPC7xx V%d.%d at %d / %d MHz",
+				 (get_pvr () >> 8) & 0xFF, get_pvr () & 0xFF, 400, 100);
+		return;
+	case 2:
+		sprintf (info, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
+				 dram_size (0) / 0x100000, flash_init () / 0x100000);
+		return;
+	case 3:
+		sprintf (info, " %s", smi.modeIdent);
+		return;
+	}
 
-    /* no more info lines */
-    *info = 0;
-    return;
+	/* no more info lines */
+	*info = 0;
+	return;
 }
 #endif
-
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/elppc/flash.c b/board/eltec/elppc/flash.c
index 73496a1..442dd00 100644
--- a/board/eltec/elppc/flash.c
+++ b/board/eltec/elppc/flash.c
@@ -57,7 +57,7 @@
     /* Init: no FLASHes known */
     for (i=0; i<CFG_MAX_FLASH_BANKS; ++i)
     {
-        flash_info[i].flash_id = FLASH_UNKNOWN;
+	flash_info[i].flash_id = FLASH_UNKNOWN;
     }
 
     /* initialise 1st flash */
@@ -65,8 +65,8 @@
 
     if (flash_info[0].flash_id == FLASH_UNKNOWN)
     {
-        printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-            size1, size1<<20);
+	printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
+	    size1, size1<<20);
     }
 
     /* initialise 2nd flash */
@@ -74,31 +74,31 @@
 
     if (flash_info[1].flash_id == FLASH_UNKNOWN)
     {
-        printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
-            size2, size2<<20);
+	printf ("## Unknown FLASH on Bank 1 - Size = 0x%08lx = %ld MB\n",
+	    size2, size2<<20);
     }
 
     /* monitor protection ON by default */
     if (size1 == 512*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                FLASH_BASE0_PRELIM,
-                FLASH_BASE0_PRELIM+monitor_flash_len-1,
-                &flash_info[0]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		FLASH_BASE0_PRELIM,
+		FLASH_BASE0_PRELIM+monitor_flash_len-1,
+		&flash_info[0]);
     }
     if (size2 == 512*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                FLASH_BASE1_PRELIM,
-                FLASH_BASE1_PRELIM+monitor_flash_len-1,
-                &flash_info[1]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		FLASH_BASE1_PRELIM,
+		FLASH_BASE1_PRELIM+monitor_flash_len-1,
+		&flash_info[1]);
     }
     if (size2 == 4*1024*1024)
     {
-        (void)flash_protect(FLAG_PROTECT_SET,
-                CFG_FLASH_BASE,
-                CFG_FLASH_BASE+monitor_flash_len-1,
-                &flash_info[1]);
+	(void)flash_protect(FLAG_PROTECT_SET,
+		CFG_FLASH_BASE,
+		CFG_FLASH_BASE+monitor_flash_len-1,
+		&flash_info[1]);
     }
 
     return (size1 + size2);
@@ -115,72 +115,72 @@
     volatile unsigned long *flash;
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        flash_init();
+	printf ("missing or unknown FLASH type\n");
+	flash_init();
     }
 
     if (info->flash_id == FLASH_UNKNOWN) {
-        printf ("missing or unknown FLASH type\n");
-        return;
+	printf ("missing or unknown FLASH type\n");
+	return;
     }
 
     switch (info->flash_id & FLASH_VENDMASK) {
     case FLASH_MAN_AMD:
-        printf ("AMD ");
-        break;
+	printf ("AMD ");
+	break;
     default:
-        printf ("Unknown Vendor ");
-        break;
+	printf ("Unknown Vendor ");
+	break;
     }
 
     switch (info->flash_id & FLASH_TYPEMASK) {
     case AMD_ID_F040B:
-        printf ("AM29F040B (4 Mbit)\n");
-        break;
+	printf ("AM29F040B (4 Mbit)\n");
+	break;
     case AMD_ID_F016D:
-        printf ("AM29F016D (16 Mbit)\n");
-        break;
+	printf ("AM29F016D (16 Mbit)\n");
+	break;
     case AMD_ID_F032B:
-        printf ("AM29F032B (32 Mbit)\n");
-        break;
+	printf ("AM29F032B (32 Mbit)\n");
+	break;
    default:
-        printf ("Unknown Chip Type\n");
-        break;
+	printf ("Unknown Chip Type\n");
+	break;
     }
 
     if (info->size >= (1 << 20)) {
-        printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
+	printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
     } else {
-        printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
+	printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
     }
 
     printf ("  Sector Start Addresses:");
     for (i=0; i<info->sector_count; ++i) {
-        /*
-        * Check if whole sector is erased
-        */
-        if (i != (info->sector_count-1))
-            size = info->start[i+1] - info->start[i];
-        else
-            size = info->start[0] + info->size - info->start[i];
+	/*
+	* Check if whole sector is erased
+	*/
+	if (i != (info->sector_count-1))
+	    size = info->start[i+1] - info->start[i];
+	else
+	    size = info->start[0] + info->size - info->start[i];
 
-        erased = 1;
-        flash = (volatile unsigned long *)info->start[i];
-        size = size >> 2;        /* divide by 4 for longword access */
-        for (k=0; k<size; k++) {
-            if (*flash++ != 0xffffffff) {
-                erased = 0;
-                break;
-            }
-        }
+	erased = 1;
+	flash = (volatile unsigned long *)info->start[i];
+	size = size >> 2;        /* divide by 4 for longword access */
+	for (k=0; k<size; k++) {
+	    if (*flash++ != 0xffffffff) {
+		erased = 0;
+		break;
+	    }
+	}
 
-        if ((i % 5) == 0)
-            printf ("\n   ");
+	if ((i % 5) == 0)
+	    printf ("\n   ");
 
-        printf (" %08lX%s%s",
-            info->start[i],
-            erased ? " E" : "  ",
-            info->protect[i] ? "RO " : "   ");
+	printf (" %08lX%s%s",
+	    info->start[i],
+	    erased ? " E" : "  ",
+	    info->protect[i] ? "RO " : "   ");
     }
     printf ("\n");
 }
@@ -226,37 +226,37 @@
     /* We accept only two AMD types */
     switch (vendor) {
     case (FLASH_WORD_SIZE)AMD_MANUFACT:
-        info->flash_id = FLASH_MAN_AMD;
-        break;
+	info->flash_id = FLASH_MAN_AMD;
+	break;
     default:
-        info->flash_id = FLASH_UNKNOWN;
-        info->sector_count = 0;
-        info->size = 0;
-        return (0);         /* no or unknown flash  */
+	info->flash_id = FLASH_UNKNOWN;
+	info->sector_count = 0;
+	info->size = 0;
+	return (0);         /* no or unknown flash  */
     }
 
     switch (devid) {
     case (FLASH_WORD_SIZE)AMD_ID_F040B:
-        info->flash_id |= AMD_ID_F040B;
-        info->sector_count = 8;
-        info->size = 0x00080000;
-        break;              /* => 0.5 MB      */
+	info->flash_id |= AMD_ID_F040B;
+	info->sector_count = 8;
+	info->size = 0x00080000;
+	break;              /* => 0.5 MB      */
 
     case (FLASH_WORD_SIZE)AMD_ID_F016D:
-        info->flash_id |= AMD_ID_F016D;
-        info->sector_count = 32;
-        info->size         = 0x00200000;
-        break;              /* => 2 MB      */
+	info->flash_id |= AMD_ID_F016D;
+	info->sector_count = 32;
+	info->size         = 0x00200000;
+	break;              /* => 2 MB      */
 
     case (FLASH_WORD_SIZE)AMD_ID_F032B:
-        info->flash_id |= AMD_ID_F032B;
-        info->sector_count = 64;
-        info->size         = 0x00400000;
-        break;              /* => 4 MB      */
+	info->flash_id |= AMD_ID_F032B;
+	info->sector_count = 64;
+	info->size         = 0x00400000;
+	break;              /* => 4 MB      */
 
     default:
-        info->flash_id = FLASH_UNKNOWN;
-        return (0);         /* => no or unknown flash */
+	info->flash_id = FLASH_UNKNOWN;
+	return (0);         /* => no or unknown flash */
 
     }
 
@@ -266,20 +266,20 @@
 
     /* check for protected sectors */
     for (i = 0; i < info->sector_count; i++) {
-        /* sector base address */
-        info->start[i] = base + i * (info->size / info->sector_count);
-        /* read sector protection at sector address, (A7 .. A0) = 0x02 */
-        /* D0 = 1 if protected */
-        caddr = (volatile unsigned char *)(info->start[i]);
-        info->protect[i] = caddr[2] & 1;
+	/* sector base address */
+	info->start[i] = base + i * (info->size / info->sector_count);
+	/* read sector protection at sector address, (A7 .. A0) = 0x02 */
+	/* D0 = 1 if protected */
+	caddr = (volatile unsigned char *)(info->start[i]);
+	info->protect[i] = caddr[2] & 1;
     }
 
     /*
      * Prevent writes to uninitialized FLASH.
      */
     if (info->flash_id != FLASH_UNKNOWN) {
-        caddr = (volatile unsigned char *)info->start[0];
-        caddr[0] = 0xF0;   /* reset bank */
+	caddr = (volatile unsigned char *)info->start[0];
+	caddr[0] = 0xF0;   /* reset bank */
     }
 
     return (info->size);
@@ -295,32 +295,32 @@
     int rc = 0;
 
     if ((s_first < 0) || (s_first > s_last)) {
-        if (info->flash_id == FLASH_UNKNOWN) {
-            printf ("- missing\n");
-        } else {
-            printf ("- no sectors to erase\n");
-        }
-        return 1;
+	if (info->flash_id == FLASH_UNKNOWN) {
+	    printf ("- missing\n");
+	} else {
+	    printf ("- no sectors to erase\n");
+	}
+	return 1;
     }
 
     if ((info->flash_id == FLASH_UNKNOWN) ||
-        (info->flash_id > FLASH_AMD_COMP)) {
-        printf ("Can't erase unknown flash type - aborted\n");
-        return 1;
+	(info->flash_id > FLASH_AMD_COMP)) {
+	printf ("Can't erase unknown flash type - aborted\n");
+	return 1;
     }
 
     prot = 0;
     for (sect=s_first; sect<=s_last; ++sect) {
-        if (info->protect[sect]) {
-            prot++;
-        }
+	if (info->protect[sect]) {
+	    prot++;
+	}
     }
 
     if (prot) {
-        printf ("- Warning: %d protected sectors will not be erased!\n",
-            prot);
+	printf ("- Warning: %d protected sectors will not be erased!\n",
+	    prot);
     } else {
-        printf ("\n");
+	printf ("\n");
     }
 
     l_sect = -1;
@@ -336,26 +336,26 @@
 
     /* Start erase on unprotected sectors */
     for (sect = s_first; sect<=s_last; sect++) {
-        if (info->protect[sect] == 0) { /* not protected */
-            addr = (FLASH_WORD_SIZE *)(info->start[sect]);
-            if (info->flash_id & FLASH_MAN_SST) {
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-                addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
-                addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-                addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-                addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
-                udelay(30000);  /* wait 30 ms */
-            }
-            else
-                addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
-            l_sect = sect;
-        }
+	if (info->protect[sect] == 0) { /* not protected */
+	    addr = (FLASH_WORD_SIZE *)(info->start[sect]);
+	    if (info->flash_id & FLASH_MAN_SST) {
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+		addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00800080;
+		addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+		addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+		addr[0] = (FLASH_WORD_SIZE)0x00500050;  /* block erase */
+		udelay(30000);  /* wait 30 ms */
+	    }
+	    else
+		addr[0] = (FLASH_WORD_SIZE)0x00300030;  /* sector erase */
+	    l_sect = sect;
+	}
     }
 
     /* re-enable interrupts if necessary */
     if (flag)
-        enable_interrupts();
+	enable_interrupts();
 
     /* wait at least 80us - let's wait 1 ms */
     udelay (1000);
@@ -364,21 +364,21 @@
      * We wait for the last triggered sector
      */
     if (l_sect < 0)
-        goto DONE;
+	goto DONE;
 
     start = get_timer (0);
     last  = start;
     addr = (FLASH_WORD_SIZE *)(info->start[l_sect]);
     while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
-        if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
-            printf ("Timeout\n");
-            return 1;
-        }
-        /* show that we're waiting */
-        if ((now - last) > 1000) {  /* every second */
-            serial_putc ('.');
-            last = now;
-        }
+	if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
+	    printf ("Timeout\n");
+	    return 1;
+	}
+	/* show that we're waiting */
+	if ((now - last) > 1000) {  /* every second */
+	    serial_putc ('.');
+	    last = now;
+	}
     }
 
 DONE:
@@ -408,42 +408,42 @@
      * handle unaligned start bytes
      */
     if ((l = addr - wp) != 0) {
-        data = 0;
-        for (i=0, cp=wp; i<l; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
-        for (; i<4 && cnt>0; ++i) {
-            data = (data << 8) | *src++;
-            --cnt;
-            ++cp;
-        }
-        for (; cnt==0 && i<4; ++i, ++cp) {
-            data = (data << 8) | (*(uchar *)cp);
-        }
+	data = 0;
+	for (i=0, cp=wp; i<l; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
+	for (; i<4 && cnt>0; ++i) {
+	    data = (data << 8) | *src++;
+	    --cnt;
+	    ++cp;
+	}
+	for (; cnt==0 && i<4; ++i, ++cp) {
+	    data = (data << 8) | (*(uchar *)cp);
+	}
 
-        if ((rc = write_word(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp += 4;
+	if ((rc = write_word(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp += 4;
     }
 
     /*
      * handle word aligned part
      */
     while (cnt >= 4) {
-        data = 0;
-        for (i=0; i<4; ++i) {
-            data = (data << 8) | *src++;
-        }
-        if ((rc = write_word(info, wp, data)) != 0) {
-            return (rc);
-        }
-        wp  += 4;
-        cnt -= 4;
+	data = 0;
+	for (i=0; i<4; ++i) {
+	    data = (data << 8) | *src++;
+	}
+	if ((rc = write_word(info, wp, data)) != 0) {
+	    return (rc);
+	}
+	wp  += 4;
+	cnt -= 4;
     }
 
     if (cnt == 0) {
-        return (0);
+	return (0);
     }
 
     /*
@@ -451,11 +451,11 @@
      */
     data = 0;
     for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
-        data = (data << 8) | *src++;
-        --cnt;
+	data = (data << 8) | *src++;
+	--cnt;
     }
     for (; i<4; ++i, ++cp) {
-        data = (data << 8) | (*(uchar *)cp);
+	data = (data << 8) | (*(uchar *)cp);
     }
 
     return (write_word(info, wp, data));
@@ -469,45 +469,44 @@
  */
 static int write_word (flash_info_t *info, ulong dest, ulong data)
 {
-        volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
-        volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
-        volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
+	volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
+	volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
+	volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
     ulong start;
     int flag;
-        int i;
+	int i;
 
     /* Check if Flash is (sufficiently) erased */
     if ((*((volatile FLASH_WORD_SIZE *)dest) &
-             (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
-        return (2);
+	     (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
+	return (2);
     }
     /* Disable interrupts which might cause a timeout here */
     flag = disable_interrupts();
 
-        for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
-          {
-            addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
-            addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
-            addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
+	for (i=0; i<4/sizeof(FLASH_WORD_SIZE); i++)
+	  {
+	    addr2[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA;
+	    addr2[ADDR1] = (FLASH_WORD_SIZE)0x00550055;
+	    addr2[ADDR0] = (FLASH_WORD_SIZE)0x00A000A0;
 
-            dest2[i] = data2[i];
+	    dest2[i] = data2[i];
 
-            /* re-enable interrupts if necessary */
-            if (flag)
-              enable_interrupts();
+	    /* re-enable interrupts if necessary */
+	    if (flag)
+	      enable_interrupts();
 
-            /* data polling for D7 */
-            start = get_timer (0);
-            while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
-                   (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
-              if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
-                return (1);
-              }
-            }
-          }
+	    /* data polling for D7 */
+	    start = get_timer (0);
+	    while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
+		   (data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
+	      if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
+		return (1);
+	      }
+	    }
+	  }
 
     return (0);
 }
 
 /*----------------------------------------------------------------------------*/
-
diff --git a/board/eltec/elppc/misc.c b/board/eltec/elppc/misc.c
index 7bfb3a4..f33aef7 100644
--- a/board/eltec/elppc/misc.c
+++ b/board/eltec/elppc/misc.c
@@ -32,7 +32,7 @@
 extern char console_buffer[CFG_CBSIZE];
 extern int l2_cache_enable (int l2control);
 extern int eepro100_write_eeprom (struct eth_device* dev, int location,
-                 int addr_len, unsigned short data);
+		 int addr_len, unsigned short data);
 extern int read_eeprom (struct eth_device* dev, int location, int addr_len);
 
 /*----------------------------------------------------------------------------*/
@@ -45,7 +45,7 @@
     uchar *s = (uchar *) (CFG_ENV_MAP_ADRS + src);
 
     while (count--)
-        *d++ = *s++;
+	*d++ = *s++;
 
     return dest;
 }
@@ -56,7 +56,7 @@
     uchar *s = (uchar *) src;
 
     while (count--)
-        *d++ = *s++;
+	*d++ = *s++;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -72,7 +72,7 @@
     u_int  i, l, initSrom, copyNv;
     char buf[256];
     char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
-                     0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
+		     0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
 
     /* Clock setting for MPC107 i2c */
     mpc107_i2c_init (MPC107_EUMB_ADDR, 0x2b);
@@ -91,166 +91,166 @@
 
     /* read out current revision srom contens */
     mpc107_srom_load (0x0000, (u_char*)&eerev, sizeof(revinfo),
-                SECOND_DEVICE, FIRST_BLOCK);
+		SECOND_DEVICE, FIRST_BLOCK);
 
     /* read out current nvram shadow image */
     nvram_read (buf, CFG_NV_SROM_COPY_ADDR, CFG_SROM_SIZE);
 
     if (strcmp (eerev.magic, "ELTEC") != 0)
     {
-        /* srom is not initialized -> create a default revision info */
-        for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
-            *ptr++ = 0x00;
-        strcpy(eerev.magic, "ELTEC");
-        eerev.revrev[0] = 1;
-        eerev.revrev[1] = 0;
-        eerev.size = 0x00E0;
-        eerev.category[0] = 0x01;
+	/* srom is not initialized -> create a default revision info */
+	for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
+	    *ptr++ = 0x00;
+	strcpy(eerev.magic, "ELTEC");
+	eerev.revrev[0] = 1;
+	eerev.revrev[1] = 0;
+	eerev.size = 0x00E0;
+	eerev.category[0] = 0x01;
 
-        /* node id from dead e128 as default */
-        eerev.etheraddr[0] = 0x00;
-        eerev.etheraddr[1] = 0x00;
-        eerev.etheraddr[2] = 0x5B;
-        eerev.etheraddr[3] = 0x00;
-        eerev.etheraddr[4] = 0x2E;
-        eerev.etheraddr[5] = 0x4D;
+	/* node id from dead e128 as default */
+	eerev.etheraddr[0] = 0x00;
+	eerev.etheraddr[1] = 0x00;
+	eerev.etheraddr[2] = 0x5B;
+	eerev.etheraddr[3] = 0x00;
+	eerev.etheraddr[4] = 0x2E;
+	eerev.etheraddr[5] = 0x4D;
 
-        /* cache config word for ELPPC */
-        *(int*)&eerev.res[0] = 0;
+	/* cache config word for ELPPC */
+	*(int*)&eerev.res[0] = 0;
 
-        initSrom = 1;  /* force dialog */
-        copyNv   = 1;  /* copy to nvram */
+	initSrom = 1;  /* force dialog */
+	copyNv   = 1;  /* copy to nvram */
     }
 
     if ((copyNv == 0) &&   (el_srom_checksum((u_char*)&eerev, CFG_SROM_SIZE) !=
-                el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
+		el_srom_checksum((u_char*)buf, CFG_SROM_SIZE)))
     {
-        printf ("Invalid revision info copy in nvram !\n");
-        printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
-        printf ("  <r> to reenter revision info.\n");
-        printf ("=> ");
-        if (0 != readline (NULL))
-        {
-            switch ((char)toupper(console_buffer[0]))
-            {
-            case 'C':
-                copyNv = 1;
-                break;
-            case 'R':
-                copyNv = 1;
-                initSrom = 1;
-                break;
-            }
-        }
+	printf ("Invalid revision info copy in nvram !\n");
+	printf ("Press key:\n  <c> to copy current revision info to nvram.\n");
+	printf ("  <r> to reenter revision info.\n");
+	printf ("=> ");
+	if (0 != readline (NULL))
+	{
+	    switch ((char)toupper(console_buffer[0]))
+	    {
+	    case 'C':
+		copyNv = 1;
+		break;
+	    case 'R':
+		copyNv = 1;
+		initSrom = 1;
+		break;
+	    }
+	}
     }
 
     if (initSrom)
     {
-        memcpy (buf, &eerev.revision[0][0], 14);     /* save all revision info */
-        printf ("Enter revision number (0-9): %c  ", eerev.revision[0][0]);
-        if (0 != readline (NULL))
-        {
-            eerev.revision[0][0] = (char)toupper(console_buffer[0]);
-            memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
-        }
+	memcpy (buf, &eerev.revision[0][0], 14);     /* save all revision info */
+	printf ("Enter revision number (0-9): %c  ", eerev.revision[0][0]);
+	if (0 != readline (NULL))
+	{
+	    eerev.revision[0][0] = (char)toupper(console_buffer[0]);
+	    memcpy (&eerev.revision[1][0], buf, 12); /* shift rest of rev info */
+	}
 
-        printf ("Enter revision character (A-Z): %c  ", eerev.revision[0][1]);
-        if (1 == readline (NULL))
-        {
-            eerev.revision[0][1] = (char)toupper(console_buffer[0]);
-        }
+	printf ("Enter revision character (A-Z): %c  ", eerev.revision[0][1]);
+	if (1 == readline (NULL))
+	{
+	    eerev.revision[0][1] = (char)toupper(console_buffer[0]);
+	}
 
-        printf ("Enter board name (V-XXXX-XXXX): %s  ", (char *)&eerev.board);
-        if (11 == readline (NULL))
-        {
-            for (i=0; i<11; i++)
-                eerev.board[i] =  (char)toupper(console_buffer[i]);
-            eerev.board[11] = '\0';
-        }
+	printf ("Enter board name (V-XXXX-XXXX): %s  ", (char *)&eerev.board);
+	if (11 == readline (NULL))
+	{
+	    for (i=0; i<11; i++)
+		eerev.board[i] =  (char)toupper(console_buffer[i]);
+	    eerev.board[11] = '\0';
+	}
 
-        printf ("Enter serial number: %s ", (char *)&eerev.serial );
-        if (6 == readline (NULL))
-        {
-            for (i=0; i<6; i++)
-                eerev.serial[i] = console_buffer[i];
-            eerev.serial[6] = '\0';
-        }
+	printf ("Enter serial number: %s ", (char *)&eerev.serial );
+	if (6 == readline (NULL))
+	{
+	    for (i=0; i<6; i++)
+		eerev.serial[i] = console_buffer[i];
+	    eerev.serial[6] = '\0';
+	}
 
-        printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
-            eerev.etheraddr[0], eerev.etheraddr[1],
-            eerev.etheraddr[2], eerev.etheraddr[3],
-            eerev.etheraddr[4], eerev.etheraddr[5]);
-        if (12 == readline (NULL))
-        {
-            for (i=0; i<12; i+=2)
-            eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
-                               hex[toupper(console_buffer[i+1])-'0']);
-        }
+	printf ("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
+	    eerev.etheraddr[0], eerev.etheraddr[1],
+	    eerev.etheraddr[2], eerev.etheraddr[3],
+	    eerev.etheraddr[4], eerev.etheraddr[5]);
+	if (12 == readline (NULL))
+	{
+	    for (i=0; i<12; i+=2)
+	    eerev.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
+			       hex[toupper(console_buffer[i+1])-'0']);
+	}
 
-        l = strlen ((char *)&eerev.text);
-        printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
-        if (0 != readline (NULL))
-        {
-            for (i = l; i<63; i++)
-                eerev.text[i] = console_buffer[i-l];
-            eerev.text[63] = '\0';
-        }
+	l = strlen ((char *)&eerev.text);
+	printf("Add to text section (max 64 chr): %s ", (char *)&eerev.text );
+	if (0 != readline (NULL))
+	{
+	    for (i = l; i<63; i++)
+		eerev.text[i] = console_buffer[i-l];
+	    eerev.text[63] = '\0';
+	}
 
-        /* prepare network eeprom */
-        memset (buf, 0, 128);
+	/* prepare network eeprom */
+	memset (buf, 0, 128);
 
-        buf[0] = eerev.etheraddr[1];
-        buf[1] = eerev.etheraddr[0];
-        buf[2] = eerev.etheraddr[3];
-        buf[3] = eerev.etheraddr[2];
-        buf[4] = eerev.etheraddr[5];
-        buf[5] = eerev.etheraddr[4];
+	buf[0] = eerev.etheraddr[1];
+	buf[1] = eerev.etheraddr[0];
+	buf[2] = eerev.etheraddr[3];
+	buf[3] = eerev.etheraddr[2];
+	buf[4] = eerev.etheraddr[5];
+	buf[5] = eerev.etheraddr[4];
 
-        *(unsigned short *)&buf[20] = 0x48B2;
-        *(unsigned short *)&buf[22] = 0x0004;
-        *(unsigned short *)&buf[24] = 0x1433;
+	*(unsigned short *)&buf[20] = 0x48B2;
+	*(unsigned short *)&buf[22] = 0x0004;
+	*(unsigned short *)&buf[24] = 0x1433;
 
-        printf("\nSRom:  Writing i82559 info ........ ");
-        if (eepro100_srom_store ((unsigned short *)buf) == -1)
-            printf("FAILED\n");
-        else
-            printf("OK\n");
+	printf("\nSRom:  Writing i82559 info ........ ");
+	if (eepro100_srom_store ((unsigned short *)buf) == -1)
+	    printf("FAILED\n");
+	else
+	    printf("OK\n");
 
-        /* update CRC */
-        eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
+	/* update CRC */
+	eerev.crc = el_srom_checksum((u_char *)eerev.board, eerev.size);
 
-        /* write new values */
-        printf("\nSRom:  Writing revision info ...... ");
-        if (mpc107_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
-                            sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
-            printf("FAILED\n\n");
-        else
-            printf("OK\n\n");
+	/* write new values */
+	printf("\nSRom:  Writing revision info ...... ");
+	if (mpc107_srom_store((BLOCK_SIZE-sizeof(revinfo)), (u_char *)&eerev,
+			    sizeof(revinfo), SECOND_DEVICE, FIRST_BLOCK) == -1)
+	    printf("FAILED\n\n");
+	else
+	    printf("OK\n\n");
 
-        /* write new values as shadow image to nvram */
-        nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
+	/* write new values as shadow image to nvram */
+	nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
 
     } /*if (initSrom) */
 
     /* copy current values as shadow image to nvram */
     if (initSrom == 0 && copyNv == 1)
-        nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
+	nvram_write (CFG_NV_SROM_COPY_ADDR, (void *)&eerev, CFG_SROM_SIZE);
 
     /* update environment */
     sprintf (buf, "%02x:%02x:%02x:%02x:%02x:%02x",
-            eerev.etheraddr[0], eerev.etheraddr[1],
-            eerev.etheraddr[2], eerev.etheraddr[3],
-            eerev.etheraddr[4], eerev.etheraddr[5]);
+	    eerev.etheraddr[0], eerev.etheraddr[1],
+	    eerev.etheraddr[2], eerev.etheraddr[3],
+	    eerev.etheraddr[4], eerev.etheraddr[5]);
     setenv ("ethaddr", buf);
 
     /* set serial console as default */
     if ((ptr = getenv ("console")) == NULL)
-        setenv ("console", "serial");
+	setenv ("console", "serial");
 
     /* print actual board identification */
     printf("Ident: %s  Ser %s  Rev %c%c\n",
-            eerev.board, (char *)&eerev.serial,
-            eerev.revision[0][0], eerev.revision[0][1]);
+	    eerev.board, (char *)&eerev.serial,
+	    eerev.revision[0][0], eerev.revision[0][1]);
 
     return (0);
 }
diff --git a/board/eltec/elppc/mpc107_i2c.c b/board/eltec/elppc/mpc107_i2c.c
index a4bf599..ae6642e 100644
--- a/board/eltec/elppc/mpc107_i2c.c
+++ b/board/eltec/elppc/mpc107_i2c.c
@@ -43,13 +43,13 @@
 
     for (; size; size--)
     {
-        byte = *ptr++;
-        for (i = 8; i; i--)
-        {
-            f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
-            accu >>= 1; accu ^= f;
-            byte >>= 1;
-        }
+	byte = *ptr++;
+	for (i = 8; i; i--)
+	{
+	    f =  ((byte & 1) ^ (accu & 1)) ? 0x84083001 : 0;
+	    accu >>= 1; accu ^= f;
+	    byte >>= 1;
+	}
     }
     return(accu);
 }
@@ -62,13 +62,13 @@
 
     while (((x = in32r(MPC107_I2CSR)) & 0x82) != 0x82)
     {
-        if (!timeout--)
-            return -1;
+	if (!timeout--)
+	    return -1;
     }
 
     if (x & 0x10)
     {
-        return -1;
+	return -1;
     }
     out32r(MPC107_I2CSR, 0);
 
@@ -81,8 +81,8 @@
 {
     while (in32r(MPC107_I2CSR) & 0x20)
     {
-        if (!timeout--)
-            return -1;
+	if (!timeout--)
+	    return -1;
     }
     return 0;
 }
@@ -99,7 +99,7 @@
     int data;
 
     if (!mpc107_eumb_addr)
-        return -6;
+	return -6;
 
     mpc107_i2c_wait_idle (timeout);
 
@@ -112,15 +112,15 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 1\n");
-        return -2;
+	printf("mpc107_i2c_read Error 1\n");
+	return -2;
     }
 
     if (in32r(MPC107_I2CSR)&0x1)
     {
-        /* Generate STOP condition; device busy or not existing */
-        out32r(MPC107_I2CCR, 0x80);
-        return -1;
+	/* Generate STOP condition; device busy or not existing */
+	out32r(MPC107_I2CCR, 0x80);
+	return -1;
     }
 
     /* Data address */
@@ -128,8 +128,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 2\n");
-        return -3;
+	printf("mpc107_i2c_read Error 2\n");
+	return -3;
     }
 
     /* Switch to read - restart */
@@ -138,8 +138,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 3\n");
-        return -4;
+	printf("mpc107_i2c_read Error 3\n");
+	return -4;
     }
 
     out32r(MPC107_I2CCR, 0xA8); /* no ACK */
@@ -147,8 +147,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_read Error 4\n");
-        return -5;
+	printf("mpc107_i2c_read Error 4\n");
+	return -5;
     }
     /* Generate STOP condition */
     out32r(MPC107_I2CCR, 0x88);
@@ -171,7 +171,7 @@
     unsigned long timeout = MPC107_I2C_TIMEOUT;
 
     if (!mpc107_eumb_addr)
-        return -6;
+	return -6;
 
     mpc107_i2c_wait_idle(timeout);
 
@@ -184,8 +184,8 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_write Error 1\n");
-        return -1;
+	printf("mpc107_i2c_write Error 1\n");
+	return -1;
     }
 
     /* Data address */
@@ -193,16 +193,16 @@
 
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_write Error 2\n");
-        return -1;
+	printf("mpc107_i2c_write Error 2\n");
+	return -1;
     }
 
     /* Write */
     out32r(MPC107_I2CDR, val);
     if (mpc107_i2c_wait(timeout) < 0)
     {
-        printf("mpc107_i2c_write Error 3\n");
-        return -1;
+	printf("mpc107_i2c_write Error 3\n");
+	return -1;
     }
 
     /* Generate Stop Condition */
@@ -227,38 +227,38 @@
 
     for (i = 0; i < cnt; i++)
     {
-        timeout=100;
-        do
-        {
-            val = mpc107_i2c_read_byte (device, block, addr);
-            if (val < -1)
-            {
-            printf("i2c_read_error %d at dev %x block %x addr %x\n",
-                   val, device, block, addr);
-            return -1;
-            }
-            else if (timeout==0)
-            {
-                printf ("i2c_read_error: timeout at dev %x block %x addr %x\n",
-                        device, block, addr);
-                return -1;
-            }
-            timeout--;
-        } while (val == -1); /* if no ack: try again! */
+	timeout=100;
+	do
+	{
+	    val = mpc107_i2c_read_byte (device, block, addr);
+	    if (val < -1)
+	    {
+	    printf("i2c_read_error %d at dev %x block %x addr %x\n",
+		   val, device, block, addr);
+	    return -1;
+	    }
+	    else if (timeout==0)
+	    {
+		printf ("i2c_read_error: timeout at dev %x block %x addr %x\n",
+			device, block, addr);
+		return -1;
+	    }
+	    timeout--;
+	} while (val == -1); /* if no ack: try again! */
 
-        *pBuf++ = (unsigned char)val;
-        addr++;
+	*pBuf++ = (unsigned char)val;
+	addr++;
 
-        if ((addr == 0) && (i != cnt-1))    /* is it the same block ? */
-        {
-            if (block == FIRST_BLOCK)
-                block = SECOND_BLOCK;
-            else
-            {
-                printf ("ic2_read_error: read beyond 2. block !\n");
-                return -1;
-            }
-        }
+	if ((addr == 0) && (i != cnt-1))    /* is it the same block ? */
+	{
+	    if (block == FIRST_BLOCK)
+		block = SECOND_BLOCK;
+	    else
+	    {
+		printf ("ic2_read_error: read beyond 2. block !\n");
+		return -1;
+	    }
+	}
     }
     udelay(100000);
     return (cnt);
@@ -277,20 +277,20 @@
 
     for (i = 0; i < cnt; i++)
     {
-        while (mpc107_i2c_write_byte (device,block,addr,*pBuf) == 1);
-        addr++;
-        pBuf++;
+	while (mpc107_i2c_write_byte (device,block,addr,*pBuf) == 1);
+	addr++;
+	pBuf++;
 
-        if ((addr == 0) && (i != cnt-1))     /* is it the same block ? */
-        {
-            if (block == FIRST_BLOCK)
-                block = SECOND_BLOCK;
-            else
-            {
-                printf ("ic2_write_error: write beyond 2. block !\n");
-                return -1;
-            }
-        }
+	if ((addr == 0) && (i != cnt-1))     /* is it the same block ? */
+	{
+	    if (block == FIRST_BLOCK)
+		block = SECOND_BLOCK;
+	    else
+	    {
+		printf ("ic2_write_error: write beyond 2. block !\n");
+		return -1;
+	    }
+	}
     }
     udelay(100000);
     return(cnt);
@@ -303,9 +303,9 @@
     unsigned long x;
 
     if (eumb_addr)
-        mpc107_eumb_addr = eumb_addr;
+	mpc107_eumb_addr = eumb_addr;
     else
-        return -1;
+	return -1;
 
     /* Set I2C clock */
     x = in32r(MPC107_I2CFDR) & 0xffffff00;
diff --git a/board/eltec/elppc/pci.c b/board/eltec/elppc/pci.c
index 2bbb5f2..5b115ea 100644
--- a/board/eltec/elppc/pci.c
+++ b/board/eltec/elppc/pci.c
@@ -42,44 +42,44 @@
     hose->last_busno = 0xff;
 
     pci_set_region(hose->regions + 0,
-        CFG_PCI_MEMORY_BUS,
-        CFG_PCI_MEMORY_PHYS,
-        CFG_PCI_MEMORY_SIZE,
-        PCI_REGION_MEM | PCI_REGION_MEMORY);
+	CFG_PCI_MEMORY_BUS,
+	CFG_PCI_MEMORY_PHYS,
+	CFG_PCI_MEMORY_SIZE,
+	PCI_REGION_MEM | PCI_REGION_MEMORY);
 
     /* PCI memory space */
     pci_set_region(hose->regions + 1,
-        CFG_PCI_MEM_BUS,
-        CFG_PCI_MEM_PHYS,
-        CFG_PCI_MEM_SIZE,
-        PCI_REGION_MEM);
+	CFG_PCI_MEM_BUS,
+	CFG_PCI_MEM_PHYS,
+	CFG_PCI_MEM_SIZE,
+	PCI_REGION_MEM);
 
     /* ISA/PCI memory space */
     pci_set_region(hose->regions + 2,
-        CFG_ISA_MEM_BUS,
-        CFG_ISA_MEM_PHYS,
-        CFG_ISA_MEM_SIZE,
-        PCI_REGION_MEM);
+	CFG_ISA_MEM_BUS,
+	CFG_ISA_MEM_PHYS,
+	CFG_ISA_MEM_SIZE,
+	PCI_REGION_MEM);
 
     /* PCI I/O space */
     pci_set_region(hose->regions + 3,
-        CFG_PCI_IO_BUS,
-        CFG_PCI_IO_PHYS,
-        CFG_PCI_IO_SIZE,
-        PCI_REGION_IO);
+	CFG_PCI_IO_BUS,
+	CFG_PCI_IO_PHYS,
+	CFG_PCI_IO_SIZE,
+	PCI_REGION_IO);
 
     /* ISA/PCI I/O space */
     pci_set_region(hose->regions + 4,
-        CFG_ISA_IO_BUS,
-        CFG_ISA_IO_PHYS,
-        CFG_ISA_IO_SIZE,
-        PCI_REGION_IO);
+	CFG_ISA_IO_BUS,
+	CFG_ISA_IO_PHYS,
+	CFG_ISA_IO_SIZE,
+	PCI_REGION_IO);
 
     hose->region_count = 5;
 
     pci_setup_indirect(hose,
-        MPC106_REG_ADDR,
-        MPC106_REG_DATA);
+	MPC106_REG_ADDR,
+	MPC106_REG_DATA);
 
     pci_register_hose(hose);
 
diff --git a/board/eltec/elppc/srom.h b/board/eltec/elppc/srom.h
index 7924bcd..c18ab91 100644
--- a/board/eltec/elppc/srom.h
+++ b/board/eltec/elppc/srom.h
@@ -81,18 +81,18 @@
 
 unsigned long el_srom_checksum (unsigned char *ptr, unsigned long size);
 int el_srom_load  (unsigned char addr, unsigned char *buf, int cnt,
-                   unsigned char device, unsigned char block);
+		   unsigned char device, unsigned char block);
 int el_srom_store (unsigned char addr, unsigned char *buf, int cnt,
-                   unsigned char device, unsigned char block);
+		   unsigned char device, unsigned char block);
 
 int mpc107_i2c_init (unsigned long eumb_addr, unsigned long divider);
 int mpc107_i2c_read_byte (unsigned char device, unsigned char block, unsigned char offset);
 int mpc107_i2c_write_byte (unsigned char device, unsigned char block,
-                           unsigned char offset, unsigned char val);
+			   unsigned char offset, unsigned char val);
 int mpc107_srom_load (unsigned char addr, unsigned char *pBuf, int cnt,
-                      unsigned char device, unsigned char block);
+		      unsigned char device, unsigned char block);
 int mpc107_srom_store (unsigned char addr, unsigned char *pBuf, int cnt,
-                       unsigned char device, unsigned char block);
+		       unsigned char device, unsigned char block);
 
 int dc_srom_load (unsigned short *dest);
 int dc_srom_store (unsigned short *src);
diff --git a/board/eltec/elppc/u-boot.lds b/board/eltec/elppc/u-boot.lds
index de50bf4..0dfa8c0 100644
--- a/board/eltec/elppc/u-boot.lds
+++ b/board/eltec/elppc/u-boot.lds
@@ -106,6 +106,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
diff --git a/board/eltec/mhpc/Makefile b/board/eltec/mhpc/Makefile
index ef173d0..13ce9fc 100644
--- a/board/eltec/mhpc/Makefile
+++ b/board/eltec/mhpc/Makefile
@@ -28,7 +28,7 @@
 OBJS	= $(BOARD).o flash.o
 
 $(LIB):	.depend $(OBJS)
-	$(AR) crv $@ $^
+	$(AR) crv $@ $(OBJS)
 
 #########################################################################
 
diff --git a/board/eltec/mhpc/config.mk b/board/eltec/mhpc/config.mk
index 607ebbc..03934de 100644
--- a/board/eltec/mhpc/config.mk
+++ b/board/eltec/mhpc/config.mk
@@ -31,19 +31,3 @@
 
 TEXT_BASE = 0xfe000000
 /*TEXT_BASE  = 0x00200000 */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/mhpc/flash.c b/board/eltec/mhpc/flash.c
index e9c8f98..4cc66a9 100644
--- a/board/eltec/mhpc/flash.c
+++ b/board/eltec/mhpc/flash.c
@@ -193,13 +193,13 @@
 
    switch (value) {
    case (FPW)INTEL_ID_28F640J5 :
-        info->flash_id += FLASH_28F640J5 ;
-        info->sector_count = 64;
-        info->size = 0x00800000;
-        break;            /* => 8 MB     */
+	info->flash_id += FLASH_28F640J5 ;
+	info->sector_count = 64;
+	info->size = 0x00800000;
+	break;            /* => 8 MB     */
 
-        default:
-                info->flash_id = FLASH_UNKNOWN;
+	default:
+		info->flash_id = FLASH_UNKNOWN;
 		break;
 	}
 
@@ -429,25 +429,3 @@
 
 	return (0);
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/board/eltec/mhpc/mhpc.c b/board/eltec/mhpc/mhpc.c
index 81f820a..83952d8 100644
--- a/board/eltec/mhpc/mhpc.c
+++ b/board/eltec/mhpc/mhpc.c
@@ -40,17 +40,17 @@
 
 extern void eeprom_init  (void);
 extern int  eeprom_read  (unsigned dev_addr, unsigned offset,
-                          unsigned char *buffer, unsigned cnt);
+			  unsigned char *buffer, unsigned cnt);
 extern int  eeprom_write (unsigned dev_addr, unsigned offset,
-                          unsigned char *buffer, unsigned cnt);
+			  unsigned char *buffer, unsigned cnt);
 
 /* globals */
 void *video_hw_init(void);
 void video_set_lut (unsigned int index,     /* color number */
-                    unsigned char r,        /* red */
-                    unsigned char g,        /* green */
-                    unsigned char b         /* blue */
-                    );
+		    unsigned char r,        /* red */
+		    unsigned char g,        /* green */
+		    unsigned char b         /* blue */
+		    );
 
 GraphicDevice gdev;
 
@@ -153,9 +153,9 @@
     revinfo  mhpcRevInfo;
     char     nid[32];
     char     *mhpcSensorTypes[] = { "OMNIVISON OV7610/7620 color",
-                                    "OMNIVISON OV7110 b&w", NULL };
+				    "OMNIVISON OV7110 b&w", NULL };
     char     hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
-                         0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
+			 0, 0, 0, 0, 10, 11, 12, 13, 14, 15 };
     int      i;
 
     /* check revision data */
@@ -166,62 +166,62 @@
     printf ("Enter revision number (0-9): %c  ", mhpcRevInfo.revision[0]);
     if (0 != readline (NULL))
     {
-        mhpcRevInfo.revision[0] = (char)toupper(console_buffer[0]);
+	mhpcRevInfo.revision[0] = (char)toupper(console_buffer[0]);
     }
 
     printf ("Enter revision character (A-Z): %c  ", mhpcRevInfo.revision[1]);
     if (1 == readline (NULL))
     {
-        mhpcRevInfo.revision[1] = (char)toupper(console_buffer[0]);
+	mhpcRevInfo.revision[1] = (char)toupper(console_buffer[0]);
     }
 
     printf("Enter board name (V-XXXX-XXXX): %s  ", (char *)&mhpcRevInfo.board);
     if (11 == readline (NULL))
     {
-        for (i=0; i<11; i++)
-        {
-            mhpcRevInfo.board[i] =  (char)toupper(console_buffer[i]);
-            mhpcRevInfo.board[11] = '\0';
-        }
+	for (i=0; i<11; i++)
+	{
+	    mhpcRevInfo.board[i] =  (char)toupper(console_buffer[i]);
+	    mhpcRevInfo.board[11] = '\0';
+	}
     }
 
     printf("Supported sensor types:\n");
     i=0;
     do
     {
-        printf("\n    \'%d\' : %s\n", i, mhpcSensorTypes[i]);
+	printf("\n    \'%d\' : %s\n", i, mhpcSensorTypes[i]);
     } while ( mhpcSensorTypes[++i] != NULL );
 
     do
     {
-        printf("\nEnter sensor number (0-255): %d  ", (int)mhpcRevInfo.sensor );
-        if (0 != readline (NULL))
-        {
-        mhpcRevInfo.sensor = (unsigned char)simple_strtoul(console_buffer, NULL, 10);
-        }
+	printf("\nEnter sensor number (0-255): %d  ", (int)mhpcRevInfo.sensor );
+	if (0 != readline (NULL))
+	{
+	mhpcRevInfo.sensor = (unsigned char)simple_strtoul(console_buffer, NULL, 10);
+	}
     } while ( mhpcRevInfo.sensor >= i );
 
     printf("Enter serial number: %s ", (char *)&mhpcRevInfo.serial );
     if (6 == readline (NULL))
     {
-        for (i=0; i<6; i++)
-        {
-        mhpcRevInfo.serial[i] = console_buffer[i];
-        }
-        mhpcRevInfo.serial[6] = '\0';
+	for (i=0; i<6; i++)
+	{
+	mhpcRevInfo.serial[i] = console_buffer[i];
+	}
+	mhpcRevInfo.serial[6] = '\0';
     }
 
     printf("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x  ",
-              mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
-              mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
-              mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]  );
+	      mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
+	      mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
+	      mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]  );
     if (12 == readline (NULL))
     {
-        for (i=0; i<12; i+=2)
-        {
-        mhpcRevInfo.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
-                             hex[toupper(console_buffer[i+1])-'0']);
-        }
+	for (i=0; i<12; i+=2)
+	{
+	mhpcRevInfo.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] +
+			     hex[toupper(console_buffer[i+1])-'0']);
+	}
     }
 
     /* setup new revision data */
@@ -230,16 +230,16 @@
 
     /* set environment */
     sprintf( nid, "%02x:%02x:%02x:%02x:%02x:%02x",
-                  mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
-                  mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
-                  mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]);
+		  mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1],
+		  mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3],
+		  mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]);
     setenv("ethaddr", nid);
 
     /* print actual board identification */
     printf("Ident: %s %s Ser %s Rev %c%c\n",
-            mhpcRevInfo.board, (mhpcRevInfo.sensor==0?"color":"b&w"),
-            (char *)&mhpcRevInfo.serial,
-            mhpcRevInfo.revision[0], mhpcRevInfo.revision[1]);
+	    mhpcRevInfo.board, (mhpcRevInfo.sensor==0?"color":"b&w"),
+	    (char *)&mhpcRevInfo.serial,
+	    mhpcRevInfo.revision[0], mhpcRevInfo.revision[1]);
 
     return (0);
 }
@@ -308,29 +308,29 @@
     *(center-x+y*pitch) = color;
     while(y>x)
     {
-        if (d<0)
-        {
-            d   += dE;
-            dE  += 2;
-            dSE += 2;
-            x++;
-        }
-        else
-        {
-            d   += dSE;
-            dE  += 2;
-            dSE += 4;
-            x++;
-            y--;
-        }
-        *(center+x+y*pitch) = color;
-        *(center+y+x*pitch) = color;
-        *(center+y-x*pitch) = color;
-        *(center+x-y*pitch) = color;
-        *(center-x-y*pitch) = color;
-        *(center-y-x*pitch) = color;
-        *(center-y+x*pitch) = color;
-        *(center-x+y*pitch) = color;
+	if (d<0)
+	{
+	    d   += dE;
+	    dE  += 2;
+	    dSE += 2;
+	    x++;
+	}
+	else
+	{
+	    d   += dSE;
+	    dE  += 2;
+	    dSE += 4;
+	    x++;
+	    y--;
+	}
+	*(center+x+y*pitch) = color;
+	*(center+y+x*pitch) = color;
+	*(center+y-x*pitch) = color;
+	*(center+x-y*pitch) = color;
+	*(center-x-y*pitch) = color;
+	*(center-y-x*pitch) = color;
+	*(center-y+x*pitch) = color;
+	*(center-x+y*pitch) = color;
     }
 }
 
@@ -344,31 +344,31 @@
     /* draw raster */
     for (i=0; i<LCD_VIDEO_ROWS; i+=32)
     {
-        memset((char*)(LCD_VIDEO_ADDR+i*LCD_VIDEO_COLS), LCD_VIDEO_FG, LCD_VIDEO_COLS);
-        for (n=i+1;n<i+32;n++)
-            memset((char*)(LCD_VIDEO_ADDR+n*LCD_VIDEO_COLS), LCD_VIDEO_BG, LCD_VIDEO_COLS);
+	memset((char*)(LCD_VIDEO_ADDR+i*LCD_VIDEO_COLS), LCD_VIDEO_FG, LCD_VIDEO_COLS);
+	for (n=i+1;n<i+32;n++)
+	    memset((char*)(LCD_VIDEO_ADDR+n*LCD_VIDEO_COLS), LCD_VIDEO_BG, LCD_VIDEO_COLS);
     }
 
     for (i=0; i<LCD_VIDEO_COLS; i+=32)
     {
-        for (n=0; n<LCD_VIDEO_ROWS; n++)
-            *(char*)(LCD_VIDEO_ADDR+n*LCD_VIDEO_COLS+i) = LCD_VIDEO_FG;
+	for (n=0; n<LCD_VIDEO_ROWS; n++)
+	    *(char*)(LCD_VIDEO_ADDR+n*LCD_VIDEO_COLS+i) = LCD_VIDEO_FG;
     }
 
     /* draw gray bar */
     di = (char *)(LCD_VIDEO_ADDR + (LCD_VIDEO_COLS-256)/64*32 + 97*LCD_VIDEO_COLS);
     for (n=0; n<63; n++)
     {
-        for (i=0; i<256; i++)
-        {
-            *di++ = (char)i;
-            *(di+LCD_VIDEO_COLS*64) = (i&1)*255;
-        }
-        di += LCD_VIDEO_COLS-256;
+	for (i=0; i<256; i++)
+	{
+	    *di++ = (char)i;
+	    *(di+LCD_VIDEO_COLS*64) = (i&1)*255;
+	}
+	di += LCD_VIDEO_COLS-256;
     }
 
     video_circle ((char*)LCD_VIDEO_ADDR+LCD_VIDEO_COLS/2+LCD_VIDEO_ROWS/2*LCD_VIDEO_COLS,
-                  LCD_VIDEO_ROWS/2,LCD_VIDEO_FG, LCD_VIDEO_COLS);
+		  LCD_VIDEO_ROWS/2,LCD_VIDEO_FG, LCD_VIDEO_COLS);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -377,36 +377,36 @@
 {
     unsigned int i;
     unsigned char RGB[] =
-        {
-        0x00, 0x00, 0x00,   /* black */
-        0x80, 0x80, 0x80,   /* gray */
-        0xff, 0x00, 0x00,   /* red */
-        0x00, 0xff, 0x00,   /* green */
-        0x00, 0x00, 0xff,   /* blue */
-        0x00, 0xff, 0xff,   /* cyan */
-        0xff, 0x00, 0xff,   /* magenta */
-        0xff, 0xff, 0x00,   /* yellow */
-        0x80, 0x00, 0x00,   /* dark red */
-        0x00, 0x80, 0x00,   /* dark green */
-        0x00, 0x00, 0x80,   /* dark blue */
-        0x00, 0x80, 0x80,   /* dark cyan */
-        0x80, 0x00, 0x80,   /* dark magenta */
-        0x80, 0x80, 0x00,   /* dark yellow */
-        0xc0, 0xc0, 0xc0,   /* light gray */
-        0xff, 0xff, 0xff,   /* white */
-        };
+	{
+	0x00, 0x00, 0x00,   /* black */
+	0x80, 0x80, 0x80,   /* gray */
+	0xff, 0x00, 0x00,   /* red */
+	0x00, 0xff, 0x00,   /* green */
+	0x00, 0x00, 0xff,   /* blue */
+	0x00, 0xff, 0xff,   /* cyan */
+	0xff, 0x00, 0xff,   /* magenta */
+	0xff, 0xff, 0x00,   /* yellow */
+	0x80, 0x00, 0x00,   /* dark red */
+	0x00, 0x80, 0x00,   /* dark green */
+	0x00, 0x00, 0x80,   /* dark blue */
+	0x00, 0x80, 0x80,   /* dark cyan */
+	0x80, 0x00, 0x80,   /* dark magenta */
+	0x80, 0x80, 0x00,   /* dark yellow */
+	0xc0, 0xc0, 0xc0,   /* light gray */
+	0xff, 0xff, 0xff,   /* white */
+	};
 
     switch (clut_type)
     {
     case 1:
-        for (i=0; i<240; i++)
-            video_set_lut (i, i, i, i);
-        for (i=0; i<16; i++)
-            video_set_lut (i+240, RGB[i*3], RGB[i*3+1], RGB[i*3+2]);
-        break;
+	for (i=0; i<240; i++)
+	    video_set_lut (i, i, i, i);
+	for (i=0; i<16; i++)
+	    video_set_lut (i+240, RGB[i*3], RGB[i*3+1], RGB[i*3+2]);
+	break;
     default:
-        for (i=0; i<256; i++)
-            video_set_lut (i, i, i, i);
+	for (i=0; i<256; i++)
+	    video_set_lut (i, i, i, i);
     }
 }
 
@@ -420,9 +420,9 @@
 
     /* enable video only on CLUT value */
     if ((penv = getenv ("clut")) != NULL)
-        clut = (u_int)simple_strtoul (penv, NULL, 10);
+	clut = (u_int)simple_strtoul (penv, NULL, 10);
     else
-        return NULL;
+	return NULL;
 
     /* disable graphic before write LCD regs. */
     immr->im_lcd.lcd_lccr = 0x96000866;
@@ -433,7 +433,7 @@
     immr->im_lcd.lcd_lcvcr = 0x900f0024;
 
     printf ("Video: 640x480 8Bit Index Lut %s\n",
-            (clut==1?"240/16 (gray/vga)":"256(gray)"));
+	    (clut==1?"240/16 (gray/vga)":"256(gray)"));
 
     video_default_lut (clut);
 
@@ -451,11 +451,11 @@
     gdev.gdfIndex = GDF__8BIT_INDEX;
 
     if (clut > 1)
-        /* return Graphic Device for console */
-        return (void *)&gdev;
+	/* return Graphic Device for console */
+	return (void *)&gdev;
     else
-        /* just graphic enabled - draw something beautiful */
-        video_test_image();
+	/* just graphic enabled - draw something beautiful */
+	video_test_image();
 
     return NULL;            /* this disabels cfb - console */
 }
@@ -463,7 +463,7 @@
 /* ------------------------------------------------------------------------- */
 
 void video_set_lut (unsigned int index,
-                    unsigned char r, unsigned char g, unsigned char b)
+		    unsigned char r, unsigned char g, unsigned char b)
 {
     unsigned int lum;
     unsigned short *pLut = (unsigned short *)(CFG_IMMR + 0x0e00);
diff --git a/board/eltec/mhpc/u-boot.lds b/board/eltec/mhpc/u-boot.lds
index 7128155..526198c 100644
--- a/board/eltec/mhpc/u-boot.lds
+++ b/board/eltec/mhpc/u-boot.lds
@@ -99,6 +99,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
@@ -121,4 +126,3 @@
   _end = . ;
   PROVIDE (end = .);
 }
-
diff --git a/board/eltec/mhpc/u-boot.lds.debug b/board/eltec/mhpc/u-boot.lds.debug
index 8dc6d40..f6f7cf4 100644
--- a/board/eltec/mhpc/u-boot.lds.debug
+++ b/board/eltec/mhpc/u-boot.lds.debug
@@ -106,6 +106,11 @@
   _edata  =  .;
   PROVIDE (edata = .);
 
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
@@ -128,4 +133,3 @@
   _end = . ;
   PROVIDE (end = .);
 }
-
